正在显示
12 个修改的文件
包含
382 行增加
和
22 行删除
app/Console/Commands/SyncChannel.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Console\Commands; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +use App\Helper\OaGlobalsoApi; | ||
| 7 | +use App\Models\Channel\Channel; | ||
| 8 | +use App\Models\Channel\User; | ||
| 9 | +use App\Models\Channel\Zone; | ||
| 10 | +use Illuminate\Console\Command; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * 渠道信息 | ||
| 14 | + * Class ChannelInfo | ||
| 15 | + * @package App\Console\Commands | ||
| 16 | + * @author zbj | ||
| 17 | + * @date 2023/6/27 | ||
| 18 | + */ | ||
| 19 | +class SyncChannel extends Command | ||
| 20 | +{ | ||
| 21 | + /** | ||
| 22 | + * The name and signature of the console command. | ||
| 23 | + * | ||
| 24 | + * @var string | ||
| 25 | + */ | ||
| 26 | + protected $signature = 'sync_channel'; | ||
| 27 | + | ||
| 28 | + /** | ||
| 29 | + * The console command description. | ||
| 30 | + * | ||
| 31 | + * @var string | ||
| 32 | + */ | ||
| 33 | + protected $description = '更新渠道信息'; | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * Create a new command instance. | ||
| 37 | + * | ||
| 38 | + * @return void | ||
| 39 | + */ | ||
| 40 | + public function __construct() | ||
| 41 | + { | ||
| 42 | + parent::__construct(); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * @return bool | ||
| 47 | + */ | ||
| 48 | + public function handle() | ||
| 49 | + { | ||
| 50 | + $api = new OaGlobalsoApi(); | ||
| 51 | + $res = $api->agents_lists(); | ||
| 52 | + if($res && !empty($res['data'])){ | ||
| 53 | + foreach ($res['data'] as $item){ | ||
| 54 | + $zone = Zone::sync($item['belong']); | ||
| 55 | + $channel = Channel::sync($item, $zone->id); | ||
| 56 | + foreach ($item['users'] as $user){ | ||
| 57 | + User::sync($user, $channel->id); | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | + return true; | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + | ||
| 65 | +} |
| @@ -27,6 +27,7 @@ class Kernel extends ConsoleKernel | @@ -27,6 +27,7 @@ class Kernel extends ConsoleKernel | ||
| 27 | $schedule->command('web_traffic 1')->everyThirtyMinutes(); // 引流 1-3个月的项目,半小时一次 | 27 | $schedule->command('web_traffic 1')->everyThirtyMinutes(); // 引流 1-3个月的项目,半小时一次 |
| 28 | $schedule->command('web_traffic 2')->cron('*/18 * * * *'); // 引流 4-8个月的项目,18分钟一次 | 28 | $schedule->command('web_traffic 2')->cron('*/18 * * * *'); // 引流 4-8个月的项目,18分钟一次 |
| 29 | $schedule->command('web_traffic 3')->cron('*/12 * * * *'); // 引流 大于9个月的项目,12分钟一次 | 29 | $schedule->command('web_traffic 3')->cron('*/12 * * * *'); // 引流 大于9个月的项目,12分钟一次 |
| 30 | + $schedule->command('sync_channel')->dailyAt('06:00')->withoutOverlapping(1); // 渠道信息,每周执行一次 | ||
| 30 | // // 更新域名|证书结束时间,每天凌晨1点执行一次 | 31 | // // 更新域名|证书结束时间,每天凌晨1点执行一次 |
| 31 | // $schedule->command('domain_time')->dailyAt('01:00')->withoutOverlapping(1); | 32 | // $schedule->command('domain_time')->dailyAt('01:00')->withoutOverlapping(1); |
| 32 | // // B站 - 网站数据统计 | 33 | // // B站 - 网站数据统计 |
app/Helper/OaGlobalsoApi.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +namespace App\Helper; | ||
| 5 | + | ||
| 6 | +use App\Utils\HttpUtils; | ||
| 7 | +use GuzzleHttp\Exception\GuzzleException; | ||
| 8 | + | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * Class OaGlobalsoApi | ||
| 12 | + * @package App\Helper | ||
| 13 | + * @author zbj | ||
| 14 | + * @date 2023/6/27 | ||
| 15 | + */ | ||
| 16 | +class OaGlobalsoApi | ||
| 17 | +{ | ||
| 18 | + | ||
| 19 | + //接口地址 | ||
| 20 | + protected $url = 'https://oa.globalso.com'; | ||
| 21 | + | ||
| 22 | + protected $token = ''; | ||
| 23 | + | ||
| 24 | + | ||
| 25 | + public function __construct() | ||
| 26 | + { | ||
| 27 | + $this->token = md5('oa' . date('Y-m-d')); | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 项目信息 | ||
| 32 | + * @author zbj | ||
| 33 | + * @date 2023/5/17 | ||
| 34 | + */ | ||
| 35 | + public function order_info($order_id) | ||
| 36 | + { | ||
| 37 | + $api_url = $this->url . '/api/order_info'; | ||
| 38 | + | ||
| 39 | + $params = [ | ||
| 40 | + 'token' => $this->token, | ||
| 41 | + 'order_id' => $order_id, | ||
| 42 | + ]; | ||
| 43 | + | ||
| 44 | + try { | ||
| 45 | + $res = HttpUtils::get($api_url, $params); | ||
| 46 | + $res = Arr::s2a($res); | ||
| 47 | + } catch (\Exception | GuzzleException $e) { | ||
| 48 | + errorLog('项目信息', $params, $e); | ||
| 49 | + return false; | ||
| 50 | + } | ||
| 51 | + return $res; | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + /** | ||
| 55 | + * 渠道信息 | ||
| 56 | + * @author zbj | ||
| 57 | + * @date 2023/5/17 | ||
| 58 | + */ | ||
| 59 | + public function agents_lists() | ||
| 60 | + { | ||
| 61 | + $api_url = $this->url . '/api/agents_lists'; | ||
| 62 | + | ||
| 63 | + $params = [ | ||
| 64 | + 'token' => $this->token, | ||
| 65 | + ]; | ||
| 66 | + | ||
| 67 | + try { | ||
| 68 | + $res = HttpUtils::get($api_url, $params); | ||
| 69 | + $res = Arr::s2a($res); | ||
| 70 | + } catch (\Exception | GuzzleException $e) { | ||
| 71 | + errorLog('渠道信息', $params, $e); | ||
| 72 | + return false; | ||
| 73 | + } | ||
| 74 | + return $res; | ||
| 75 | + } | ||
| 76 | +} |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | 2 | ||
| 3 | namespace App\Http\Controllers\Aside; | 3 | namespace App\Http\Controllers\Aside; |
| 4 | 4 | ||
| 5 | -use App\Models\Manage\Manage; | 5 | +use App\Http\Logic\Aside\Project\ProjectLogic; |
| 6 | use App\Utils\LogUtils; | 6 | use App\Utils\LogUtils; |
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| @@ -21,10 +21,13 @@ class NoticeController extends BaseController | @@ -21,10 +21,13 @@ class NoticeController extends BaseController | ||
| 21 | * @author zbj | 21 | * @author zbj |
| 22 | * @date 2023/6/26 | 22 | * @date 2023/6/26 |
| 23 | */ | 23 | */ |
| 24 | - public function project() | 24 | + public function project(ProjectLogic $logic) |
| 25 | { | 25 | { |
| 26 | //首次 续费 | 26 | //首次 续费 |
| 27 | LogUtils::info('notice project', $this->param); | 27 | LogUtils::info('notice project', $this->param); |
| 28 | + if($this->param['order_type'] == '首次'){ | ||
| 29 | + $logic->sync($this->param); | ||
| 30 | + } | ||
| 28 | return $this->success(); | 31 | return $this->success(); |
| 29 | } | 32 | } |
| 30 | 33 |
| @@ -9,6 +9,7 @@ use App\Http\Logic\Aside\Project\ProjectLogic; | @@ -9,6 +9,7 @@ use App\Http\Logic\Aside\Project\ProjectLogic; | ||
| 9 | use App\Http\Requests\Aside\Project\ProcessRecordsRequest; | 9 | use App\Http\Requests\Aside\Project\ProcessRecordsRequest; |
| 10 | use App\Http\Requests\Aside\Project\ProjectRequest; | 10 | use App\Http\Requests\Aside\Project\ProjectRequest; |
| 11 | use App\Models\InquirySet; | 11 | use App\Models\InquirySet; |
| 12 | +use App\Models\Project\Payment; | ||
| 12 | use App\Rules\Ids; | 13 | use App\Rules\Ids; |
| 13 | use Illuminate\Http\Request; | 14 | use Illuminate\Http\Request; |
| 14 | 15 | ||
| @@ -100,6 +101,20 @@ class ProjectController extends BaseController | @@ -100,6 +101,20 @@ class ProjectController extends BaseController | ||
| 100 | } | 101 | } |
| 101 | 102 | ||
| 102 | /** | 103 | /** |
| 104 | + * 渠道数据源 | ||
| 105 | + * @param ProjectLogic $logic | ||
| 106 | + * @return \Illuminate\Http\JsonResponse | ||
| 107 | + * @throws \Psr\Container\ContainerExceptionInterface | ||
| 108 | + * @throws \Psr\Container\NotFoundExceptionInterface | ||
| 109 | + * @author zbj | ||
| 110 | + * @date 2023/6/27 | ||
| 111 | + */ | ||
| 112 | + public function channel_source(ProjectLogic $logic){ | ||
| 113 | + $data = $logic->channelSource($this->param); | ||
| 114 | + return $this->success($data); | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + /** | ||
| 103 | * 进程记录 | 118 | * 进程记录 |
| 104 | * @author zbj | 119 | * @author zbj |
| 105 | * @date 2023/6/25 | 120 | * @date 2023/6/25 |
| @@ -124,4 +139,20 @@ class ProjectController extends BaseController | @@ -124,4 +139,20 @@ class ProjectController extends BaseController | ||
| 124 | $data = $logic->save($this->param); | 139 | $data = $logic->save($this->param); |
| 125 | return $this->success($data); | 140 | return $this->success($data); |
| 126 | } | 141 | } |
| 142 | + | ||
| 143 | + /** | ||
| 144 | + * 获取合同票据 | ||
| 145 | + * @author zbj | ||
| 146 | + * @date 2023/6/27 | ||
| 147 | + */ | ||
| 148 | + public function get_contract_bill(Request $request){ | ||
| 149 | + $request->validate([ | ||
| 150 | + 'id'=>'required' | ||
| 151 | + ],[ | ||
| 152 | + 'id.required' => 'ID不能为空' | ||
| 153 | + ]); | ||
| 154 | + $payment = Payment::where('project_id', $this->param['id'])->select(['contract', 'bill'])->first(); | ||
| 155 | + $data = $payment->makeVisible(['contract', 'bill']); | ||
| 156 | + return $this->success($data ? $data->toArray() : []); | ||
| 157 | + } | ||
| 127 | } | 158 | } |
| @@ -7,6 +7,9 @@ use App\Helper\Arr; | @@ -7,6 +7,9 @@ use App\Helper\Arr; | ||
| 7 | use App\Helper\FormGlobalsoApi; | 7 | use App\Helper\FormGlobalsoApi; |
| 8 | use App\Http\Logic\Aside\BaseLogic; | 8 | use App\Http\Logic\Aside\BaseLogic; |
| 9 | use App\Http\Logic\Aside\Manage\ManageLogic; | 9 | use App\Http\Logic\Aside\Manage\ManageLogic; |
| 10 | +use App\Models\Channel\Channel; | ||
| 11 | +use App\Models\Channel\User; | ||
| 12 | +use App\Models\Channel\Zone; | ||
| 10 | use App\Models\City; | 13 | use App\Models\City; |
| 11 | use App\Models\InquirySet; | 14 | use App\Models\InquirySet; |
| 12 | use App\Models\Project\DeployBuild; | 15 | use App\Models\Project\DeployBuild; |
| @@ -38,7 +41,7 @@ class ProjectLogic extends BaseLogic | @@ -38,7 +41,7 @@ class ProjectLogic extends BaseLogic | ||
| 38 | $item = [ | 41 | $item = [ |
| 39 | 'id' => $item['id'], | 42 | 'id' => $item['id'], |
| 40 | 'title' => $item['title'], | 43 | 'title' => $item['title'], |
| 41 | - 'channel' => ($item['channel']['channel']??'') . ' - ' . ($item['channel']['saler']??''), | 44 | + 'channel' => Channel::getChannelText($item['channel']['user_id'] ?? 0), |
| 42 | 'key' => $item['deploy_build']['keyword_num'] ?? 0, | 45 | 'key' => $item['deploy_build']['keyword_num'] ?? 0, |
| 43 | 'day' => $item['deploy_build']['service_duration'] ?? 0, | 46 | 'day' => $item['deploy_build']['service_duration'] ?? 0, |
| 44 | 'amount' => $item['payment']['amount'] ?? 0, | 47 | 'amount' => $item['payment']['amount'] ?? 0, |
| @@ -78,6 +81,7 @@ class ProjectLogic extends BaseLogic | @@ -78,6 +81,7 @@ class ProjectLogic extends BaseLogic | ||
| 78 | if(!empty($param['payment']['amount'])) unset($param['payment']['amount']); | 81 | if(!empty($param['payment']['amount'])) unset($param['payment']['amount']); |
| 79 | if(!empty($param['deploy_build']['test_domain'])) unset($param['deploy_build']['test_domain']); | 82 | if(!empty($param['deploy_build']['test_domain'])) unset($param['deploy_build']['test_domain']); |
| 80 | if(!empty($param['deploy_build']['plan'])) unset($param['deploy_build']['plan']); | 83 | if(!empty($param['deploy_build']['plan'])) unset($param['deploy_build']['plan']); |
| 84 | + if(!empty($param['deploy_optimize']['api_no'])) unset($param['deploy_optimize']['api_no']); | ||
| 81 | $res = parent::save($param); | 85 | $res = parent::save($param); |
| 82 | $param['id'] = $res['id']; | 86 | $param['id'] = $res['id']; |
| 83 | $this->savePayment($param); | 87 | $this->savePayment($param); |
| @@ -105,7 +109,7 @@ class ProjectLogic extends BaseLogic | @@ -105,7 +109,7 @@ class ProjectLogic extends BaseLogic | ||
| 105 | $data = $param['payment']; | 109 | $data = $param['payment']; |
| 106 | $data['project_id'] = $param['id']; | 110 | $data['project_id'] = $param['id']; |
| 107 | $data['id'] = Payment::where('project_id', $param['id'])->value('id'); | 111 | $data['id'] = Payment::where('project_id', $param['id'])->value('id'); |
| 108 | - Arr::forget($data, ['amount']); | 112 | +// Arr::forget($data, ['amount']); |
| 109 | return (new PaymentLogic)->save($data); | 113 | return (new PaymentLogic)->save($data); |
| 110 | } | 114 | } |
| 111 | 115 | ||
| @@ -121,7 +125,7 @@ class ProjectLogic extends BaseLogic | @@ -121,7 +125,7 @@ class ProjectLogic extends BaseLogic | ||
| 121 | $data = $param['deploy_build']; | 125 | $data = $param['deploy_build']; |
| 122 | $data['project_id'] = $param['id']; | 126 | $data['project_id'] = $param['id']; |
| 123 | $data['id'] = DeployBuild::where('project_id', $param['id'])->value('id'); | 127 | $data['id'] = DeployBuild::where('project_id', $param['id'])->value('id'); |
| 124 | - Arr::forget($data, ['test_domain', 'plan']); | 128 | +// Arr::forget($data, ['test_domain', 'plan']); |
| 125 | return (new DeployBuildLogic)->save($data); | 129 | return (new DeployBuildLogic)->save($data); |
| 126 | } | 130 | } |
| 127 | 131 | ||
| @@ -137,6 +141,7 @@ class ProjectLogic extends BaseLogic | @@ -137,6 +141,7 @@ class ProjectLogic extends BaseLogic | ||
| 137 | $data = $param['deploy_optimize']; | 141 | $data = $param['deploy_optimize']; |
| 138 | $data['project_id'] = $param['id']; | 142 | $data['project_id'] = $param['id']; |
| 139 | $data['id'] = DeployOptimize::where('project_id', $param['id'])->value('id'); | 143 | $data['id'] = DeployOptimize::where('project_id', $param['id'])->value('id'); |
| 144 | +// Arr::forget($data, ['api_no']); | ||
| 140 | return (new DeployOptimizeLogic)->save($data); | 145 | return (new DeployOptimizeLogic)->save($data); |
| 141 | } | 146 | } |
| 142 | 147 | ||
| @@ -191,4 +196,56 @@ class ProjectLogic extends BaseLogic | @@ -191,4 +196,56 @@ class ProjectLogic extends BaseLogic | ||
| 191 | } | 196 | } |
| 192 | 197 | ||
| 193 | 198 | ||
| 199 | + public function channelSource($param){ | ||
| 200 | + switch ($param['type']){ | ||
| 201 | + case 1: | ||
| 202 | + return Zone::pluck('title', 'id')->toArray(); | ||
| 203 | + case 2: | ||
| 204 | + return Channel::where('zone_id', $param['zone_id']??0)->pluck('alias', 'id')->toArray(); | ||
| 205 | + case 3: | ||
| 206 | + return User::where('channel_id', $param['channel_id']??0)->pluck('name', 'id')->toArray(); | ||
| 207 | + } | ||
| 208 | + return []; | ||
| 209 | + } | ||
| 210 | + | ||
| 211 | + | ||
| 212 | + public function sync($param){ | ||
| 213 | + $data = [ | ||
| 214 | + 'title' => $param['company_name'], | ||
| 215 | + 'company' => $param['company_name'], | ||
| 216 | + 'lead_name' => $param['principal_name'], | ||
| 217 | + 'mobile' => $param['principal_mobile'], | ||
| 218 | + 'qq' => $param['customer_qq'], | ||
| 219 | + 'channel' => Channel::getProjectChannel($param['company_id'], $param['username_sales']), | ||
| 220 | + 'requirement' => $param['remark'], | ||
| 221 | + 'cooperate_date' => date('Y-m-d', $param['create_time']), | ||
| 222 | + 'deploy_build' => [ | ||
| 223 | + 'service_duration' => $param['id'], | ||
| 224 | + 'plan' => [$param['plan_marketing']] | ||
| 225 | + ], | ||
| 226 | + 'deploy_optimize' => [ | ||
| 227 | + 'api_no' => $param['id'] | ||
| 228 | + ], | ||
| 229 | + 'payment' => [ | ||
| 230 | + 'amount' => $param['plan_price'], | ||
| 231 | + 'contract' => $param['files'], | ||
| 232 | + 'bill' => $param['images'], | ||
| 233 | + ], | ||
| 234 | + ]; | ||
| 235 | + | ||
| 236 | + DB::beginTransaction(); | ||
| 237 | + try { | ||
| 238 | + $res = parent::save($data); | ||
| 239 | + $data['id'] = $res['id']; | ||
| 240 | + $this->savePayment($data); | ||
| 241 | + $this->saveDeployBuild($data); | ||
| 242 | + $this->saveDeployOptimize($data); | ||
| 243 | + | ||
| 244 | + DB::commit(); | ||
| 245 | + }catch (\Exception $e){ | ||
| 246 | + DB::rollBack(); | ||
| 247 | + errorLog('项目同步失败', $data, $e); | ||
| 248 | + $this->fail('同步失败'); | ||
| 249 | + } | ||
| 250 | + } | ||
| 194 | } | 251 | } |
app/Models/Channel/Channel.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Models\Channel; | ||
| 4 | + | ||
| 5 | +use Illuminate\Database\Eloquent\Model; | ||
| 6 | +use phpDocumentor\Reflection\Types\Self_; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * Class Channel | ||
| 10 | + * @package App\Models | ||
| 11 | + * @author zbj | ||
| 12 | + * @date 2023/6/27 | ||
| 13 | + */ | ||
| 14 | +class Channel extends Model | ||
| 15 | +{ | ||
| 16 | + //设置关联表名 | ||
| 17 | + protected $table = 'gl_channel'; | ||
| 18 | + | ||
| 19 | + | ||
| 20 | + public function sync($data, $zone_id){ | ||
| 21 | + $channel = self::where('source_id', $data['id'])->first(); | ||
| 22 | + if(!$channel){ | ||
| 23 | + $channel = new self(); | ||
| 24 | + } | ||
| 25 | + $channel->zone_id = $zone_id; | ||
| 26 | + $channel->title = $data['company_name']; | ||
| 27 | + $channel->alias = $data['company_alias']; | ||
| 28 | + $channel->province = $data['province']; | ||
| 29 | + $channel->contact_name = $data['contact_name']; | ||
| 30 | + $channel->contact_mobile = $data['contact_mobile']; | ||
| 31 | + $channel->source_id = $data['id']; | ||
| 32 | + $channel->save(); | ||
| 33 | + return $channel; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + public static function getProjectChannel($source_id, $sales){ | ||
| 37 | + $channel = self::where('source_id', $source_id)->first(); | ||
| 38 | + if(!$channel){ | ||
| 39 | + return []; | ||
| 40 | + } | ||
| 41 | + $user = User::where('channel_id', $channel['id'])->where('name', $sales)->first(); | ||
| 42 | + return [ | ||
| 43 | + 'zone_id' => $channel['zone_id'], | ||
| 44 | + 'channel_id' => $channel['id'], | ||
| 45 | + 'user_id' => $user['id'] ?? '', | ||
| 46 | + ]; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + public static function getChannelText($sales_id){ | ||
| 50 | + $user = User::where('id', $sales_id)->select(['name', 'channel_id'])->first(); | ||
| 51 | + if(!$user){ | ||
| 52 | + return ''; | ||
| 53 | + } | ||
| 54 | + $channel_alias = self::where('id', $user['channel_id'])->value('alias'); | ||
| 55 | + return $channel_alias . '-' . $user['name']; | ||
| 56 | + } | ||
| 57 | +} |
app/Models/Channel/User.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Models\Channel; | ||
| 4 | + | ||
| 5 | +use Illuminate\Database\Eloquent\Model; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * Class User | ||
| 9 | + * @package App\Models | ||
| 10 | + * @author zbj | ||
| 11 | + * @date 2023/6/27 | ||
| 12 | + */ | ||
| 13 | +class User extends Model | ||
| 14 | +{ | ||
| 15 | + //设置关联表名 | ||
| 16 | + protected $table = 'gl_channel_user'; | ||
| 17 | + | ||
| 18 | + public static function sync($name, $channel_id){ | ||
| 19 | + $user = self::where('channel_id', $channel_id)->where('name', $name)->first(); | ||
| 20 | + if(!$user){ | ||
| 21 | + $user = new self(); | ||
| 22 | + $user->name = $name; | ||
| 23 | + $user->channel_id = $channel_id; | ||
| 24 | + $user->save(); | ||
| 25 | + } | ||
| 26 | + return $user; | ||
| 27 | + } | ||
| 28 | +} |
app/Models/Channel/Zone.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Models\Channel; | ||
| 4 | + | ||
| 5 | +use Illuminate\Database\Eloquent\Model; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * Class Zone | ||
| 9 | + * @package App\Models | ||
| 10 | + * @author zbj | ||
| 11 | + * @date 2023/6/27 | ||
| 12 | + */ | ||
| 13 | +class Zone extends Model | ||
| 14 | +{ | ||
| 15 | + //设置关联表名 | ||
| 16 | + protected $table = 'gl_channel_zone'; | ||
| 17 | + | ||
| 18 | + | ||
| 19 | + public static function sync($title){ | ||
| 20 | + $zone = self::where('title', $title)->first(); | ||
| 21 | + if(!$zone){ | ||
| 22 | + $zone = new self(); | ||
| 23 | + $zone->title = $title; | ||
| 24 | + $zone->save(); | ||
| 25 | + } | ||
| 26 | + return $zone; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | +} |
| @@ -10,6 +10,7 @@ class Payment extends Base | @@ -10,6 +10,7 @@ class Payment extends Base | ||
| 10 | //设置关联表名 | 10 | //设置关联表名 |
| 11 | protected $table = 'gl_project_payment'; | 11 | protected $table = 'gl_project_payment'; |
| 12 | 12 | ||
| 13 | + protected $hidden = ['contract', 'bill']; | ||
| 13 | 14 | ||
| 14 | public function setRenewalRecordAttribute($value){ | 15 | public function setRenewalRecordAttribute($value){ |
| 15 | $this->attributes['renewal_record'] = Arr::a2s($value); | 16 | $this->attributes['renewal_record'] = Arr::a2s($value); |
| @@ -19,4 +20,20 @@ class Payment extends Base | @@ -19,4 +20,20 @@ class Payment extends Base | ||
| 19 | return Arr::s2a($value); | 20 | return Arr::s2a($value); |
| 20 | } | 21 | } |
| 21 | 22 | ||
| 23 | + public function setContractAttribute($value){ | ||
| 24 | + $this->attributes['contract'] = Arr::a2s($value); | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + public function getContractAttribute($value){ | ||
| 28 | + return Arr::s2a($value); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + public function setBillAttribute($value){ | ||
| 32 | + $this->attributes['bill'] = Arr::a2s($value); | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + public function getBillAttribute($value){ | ||
| 36 | + return Arr::s2a($value); | ||
| 37 | + } | ||
| 38 | + | ||
| 22 | } | 39 | } |
| @@ -54,21 +54,15 @@ class Project extends Base | @@ -54,21 +54,15 @@ class Project extends Base | ||
| 54 | public static function planMap() | 54 | public static function planMap() |
| 55 | { | 55 | { |
| 56 | return [ | 56 | return [ |
| 57 | - 1 => '营销大师-体验版', | ||
| 58 | - 2 => '营销大师-标准版', | ||
| 59 | - 3 => '营销大师-商务版', | ||
| 60 | - 4 => '营销大师-旗舰版', | ||
| 61 | - 5 => '数据大师-体验版', | ||
| 62 | - 6 => '数据大师-智能版', | ||
| 63 | - 7 => '数据大师-智慧版', | ||
| 64 | - 8 => 'PLUS-尊享版', | ||
| 65 | - 9 => 'PLUS-尊贵版', | ||
| 66 | - 10 => 'PLUS-至尊版', | ||
| 67 | - 11 => '防疫物质推广方案', | ||
| 68 | - 12 => '疫情期间免费版', | ||
| 69 | - 13 => '建站大师定制优化方案', | ||
| 70 | - 14 => '星链网站(1年版)', | ||
| 71 | - 15 => '星链网站(2年版)', | 57 | + 1 => '标准版', |
| 58 | + 2 => '商务版', | ||
| 59 | + 3 => '旗舰版', | ||
| 60 | + 4 => '【PLUS】尊贵版', | ||
| 61 | + 5 => '【PLUS】至尊版', | ||
| 62 | + 6 => '仅建站(模板)', | ||
| 63 | + 7 => '仅建站(订制)', | ||
| 64 | + 8 => '星链网站(1年版)', | ||
| 65 | + 9 => '星链网站(2年版)' | ||
| 72 | ]; | 66 | ]; |
| 73 | } | 67 | } |
| 74 | 68 |
| @@ -129,9 +129,11 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -129,9 +129,11 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 129 | Route::get('/info', [Aside\Project\ProjectController::class, 'info'])->name('admin.project_info'); | 129 | Route::get('/info', [Aside\Project\ProjectController::class, 'info'])->name('admin.project_info'); |
| 130 | Route::post('/save', [Aside\Project\ProjectController::class, 'save'])->name('admin.project_save'); | 130 | Route::post('/save', [Aside\Project\ProjectController::class, 'save'])->name('admin.project_save'); |
| 131 | Route::any('/inquiry_set', [Aside\Project\ProjectController::class, 'inquiry_set'])->name('admin.project_inquiry_set'); | 131 | Route::any('/inquiry_set', [Aside\Project\ProjectController::class, 'inquiry_set'])->name('admin.project_inquiry_set'); |
| 132 | - Route::any('/data_source', [Aside\Project\ProjectController::class, 'data_source'])->name('admin.project_data_source'); | ||
| 133 | Route::any('/get_process_records', [Aside\Project\ProjectController::class, 'get_process_records'])->name('admin.project_get_process_records'); | 132 | Route::any('/get_process_records', [Aside\Project\ProjectController::class, 'get_process_records'])->name('admin.project_get_process_records'); |
| 134 | Route::any('/save_process_records', [Aside\Project\ProjectController::class, 'save_process_records'])->name('admin.project_save_process_records'); | 133 | Route::any('/save_process_records', [Aside\Project\ProjectController::class, 'save_process_records'])->name('admin.project_save_process_records'); |
| 134 | + Route::any('/get_contract_bill', [Aside\Project\ProjectController::class, 'get_contract_bill'])->name('admin.project_get_contract_bill'); | ||
| 135 | + Route::any('/data_source', [Aside\Project\ProjectController::class, 'data_source'])->name('admin.project_data_source.white'); | ||
| 136 | + Route::any('/channel_source', [Aside\Project\ProjectController::class, 'channel_source'])->name('admin.project_channel_source.white'); | ||
| 135 | }); | 137 | }); |
| 136 | 138 | ||
| 137 | //工单管理 | 139 | //工单管理 |
| @@ -215,7 +217,7 @@ Route::group([], function () { | @@ -215,7 +217,7 @@ Route::group([], function () { | ||
| 215 | Route::any('/image/{hash}/{w?}/{h?}', [\App\Http\Controllers\File\ImageController::class, 'index'])->name('admin.image_show'); | 217 | Route::any('/image/{hash}/{w?}/{h?}', [\App\Http\Controllers\File\ImageController::class, 'index'])->name('admin.image_show'); |
| 216 | Route::any('/file/{hash}', [\App\Http\Controllers\File\FileController::class, 'index'])->name('admin.file_show'); | 218 | Route::any('/file/{hash}', [\App\Http\Controllers\File\FileController::class, 'index'])->name('admin.file_show'); |
| 217 | 219 | ||
| 218 | - Route::get('/notice/project', [Aside\NoticeController::class, 'project'])->name('admin.notice.project'); | 220 | + Route::any('/notice/project', [Aside\NoticeController::class, 'project'])->name('admin.notice.project'); |
| 219 | }); | 221 | }); |
| 220 | 222 | ||
| 221 | 223 |
-
请 注册 或 登录 后发表评论