Merge remote-tracking branch 'origin/master' into akun
正在显示
10 个修改的文件
包含
257 行增加
和
18 行删除
| @@ -34,8 +34,9 @@ class UpgradeCount extends Command | @@ -34,8 +34,9 @@ class UpgradeCount extends Command | ||
| 34 | 34 | ||
| 35 | public function handle(){ | 35 | public function handle(){ |
| 36 | $projectModel = new Project(); | 36 | $projectModel = new Project(); |
| 37 | - $list = $projectModel->list(['is_upgrade'=>1,'delete_status'=>0]); | 37 | + $list = $projectModel->list(['is_upgrade'=>1,'delete_status'=>0,'id'=>['<=',550]]); |
| 38 | foreach ($list as $v) { | 38 | foreach ($list as $v) { |
| 39 | + echo date('Y-m-d H:i:s') . '项目id:'.$v['id'] . PHP_EOL; | ||
| 39 | ProjectServer::useProject($v['id']); | 40 | ProjectServer::useProject($v['id']); |
| 40 | $this->count($v['id']); | 41 | $this->count($v['id']); |
| 41 | DB::disconnect('custom_mysql'); | 42 | DB::disconnect('custom_mysql'); |
| @@ -58,10 +59,10 @@ class UpgradeCount extends Command | @@ -58,10 +59,10 @@ class UpgradeCount extends Command | ||
| 58 | if(!empty($list)){ | 59 | if(!empty($list)){ |
| 59 | $arr = []; | 60 | $arr = []; |
| 60 | foreach ($list as $k=>$v){ | 61 | foreach ($list as $k=>$v){ |
| 62 | + $v = (array)$v; | ||
| 61 | if($v['updated_date'] == date('Y-m-d')){ | 63 | if($v['updated_date'] == date('Y-m-d')){ |
| 62 | continue; | 64 | continue; |
| 63 | } | 65 | } |
| 64 | - $v = (array)$v; | ||
| 65 | echo date('Y-m-d H:i:s') . '时间:'.$v['updated_date'] . PHP_EOL; | 66 | echo date('Y-m-d H:i:s') . '时间:'.$v['updated_date'] . PHP_EOL; |
| 66 | $count = new Count(); | 67 | $count = new Count(); |
| 67 | $arr['project_id'] = $project_id; | 68 | $arr['project_id'] = $project_id; |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :UpgradeProjectCount.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2024/1/8 9:03 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Console\Commands\MonthlyCount; | ||
| 11 | + | ||
| 12 | +use App\Helper\FormGlobalsoApi; | ||
| 13 | +use App\Models\Com\UpdateOldInfo; | ||
| 14 | +use App\Models\Domain\DomainInfo; | ||
| 15 | +use App\Models\HomeCount\MonthCount; | ||
| 16 | +use App\Models\Project\Project; | ||
| 17 | +use App\Models\Visit\Visit; | ||
| 18 | +use App\Services\ProjectServer; | ||
| 19 | +use Illuminate\Console\Command; | ||
| 20 | +use Illuminate\Support\Facades\DB; | ||
| 21 | +use App\Models\HomeCount\Count; | ||
| 22 | + | ||
| 23 | +class UpgradeCount extends Command | ||
| 24 | +{ | ||
| 25 | + /** | ||
| 26 | + * The name and signature of the console command. | ||
| 27 | + * | ||
| 28 | + * @var string | ||
| 29 | + */ | ||
| 30 | + protected $signature = 'upgrade_month_count'; | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * The console command description. | ||
| 34 | + * | ||
| 35 | + * @var string | ||
| 36 | + */ | ||
| 37 | + protected $description = '升级项目统计-月统计'; | ||
| 38 | + | ||
| 39 | + public function handle(){ | ||
| 40 | + $projectModel = new Project(); | ||
| 41 | + $list = $projectModel->list(['is_upgrade'=>1,'delete_status'=>0,'id'=>['<=',456]]); | ||
| 42 | + foreach ($list as $v) { | ||
| 43 | + $oldModel = new UpdateOldInfo(); | ||
| 44 | + $info = $oldModel->read(['project_id' => $v['id']]); | ||
| 45 | + if ($info !== false) { | ||
| 46 | + $url = $info['old_domain_online']; | ||
| 47 | + }else{ | ||
| 48 | + continue; | ||
| 49 | + } | ||
| 50 | + ProjectServer::useProject($v['id']); | ||
| 51 | + echo date('Y-m-d H:i:s') . '项目id:'.$v['id'] . PHP_EOL; | ||
| 52 | + $this->count($v['id'], $url); | ||
| 53 | + DB::disconnect('custom_mysql'); | ||
| 54 | + } | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + /** | ||
| 58 | + * @remark :日统计记录 | ||
| 59 | + * @name :count | ||
| 60 | + * @author :lyh | ||
| 61 | + * @method :post | ||
| 62 | + * @time :2024/1/8 9:05 | ||
| 63 | + */ | ||
| 64 | + public function count($project_id,$url){ | ||
| 65 | + $list = DB::connection('custom_mysql')->table('gl_customer_visit') | ||
| 66 | + ->select(DB::raw('DATE_FORMAT(updated_date, "%Y-%m") as month')) | ||
| 67 | + ->groupBy('month')->get()->toArray(); | ||
| 68 | + foreach ($list as $k=>$v){ | ||
| 69 | + $v = (array)$v; | ||
| 70 | + if($v['month'] == date('Y-m')){ | ||
| 71 | + continue; | ||
| 72 | + } | ||
| 73 | + $monthCountModel = new MonthCount(); | ||
| 74 | + $info = $monthCountModel->read(['month'=>$v['month'],'project_id'=>$project_id]); | ||
| 75 | + // 获取当月开始时间 | ||
| 76 | + $start = date('Y-m-01', strtotime($v['month'])); | ||
| 77 | + // 获取当月结束时间 | ||
| 78 | + $end = date('Y-m-t', strtotime($v['month'])); | ||
| 79 | + $arr['project_id'] = $project_id; | ||
| 80 | + $res = $this->inquiry($url,$v['month']); | ||
| 81 | +// $arr['month_total'] = 0; | ||
| 82 | + if(isset($res['data']['count'])){ | ||
| 83 | + echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL; | ||
| 84 | + $arr['month_total'] = $res['data']['count']; | ||
| 85 | + //获取上一个的count | ||
| 86 | + $previousMonth = date('Y-m', strtotime($v['month'] . ' -1 month')); | ||
| 87 | + $previousInfo = $monthCountModel->read(['month'=>$previousMonth,'project_id'=>$project_id]); | ||
| 88 | + if($previousInfo === false){ | ||
| 89 | + $arr['total'] = $arr['month_total']; | ||
| 90 | + }else{ | ||
| 91 | + $arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0); | ||
| 92 | + } | ||
| 93 | + } | ||
| 94 | + if(isset($res['data']['data'])){ | ||
| 95 | + $arr['country'] = json_encode($res['data']['data']); | ||
| 96 | + } | ||
| 97 | + $arr['month'] = $v['month']; | ||
| 98 | + $arr = $this->pv_ip($arr,$start,$end,$project_id); | ||
| 99 | + $arr = $this->sourceCount($arr,$start,$end); | ||
| 100 | + if($info === false){ | ||
| 101 | + $selectedDate = $start; | ||
| 102 | + $firstDayOfNextMonth = date('Y-m-01 01:00:00', strtotime("$selectedDate +1 month")); | ||
| 103 | + $arr['created_at'] = $firstDayOfNextMonth; | ||
| 104 | + $arr['updated_at'] = $firstDayOfNextMonth; | ||
| 105 | +// echo date('Y-m-d H:i:s') . '数据:'.json_encode($arr) . PHP_EOL; | ||
| 106 | + $monthCountModel->insert($arr); | ||
| 107 | + }else{ | ||
| 108 | + $monthCountModel->edit($arr,['id'=>$info['id']]); | ||
| 109 | + } | ||
| 110 | + } | ||
| 111 | + echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + /** | ||
| 115 | + * @remark :本月询盘总量 | ||
| 116 | + * @name :month_total | ||
| 117 | + * @author :lyh | ||
| 118 | + * @method :post | ||
| 119 | + * @time :2024/1/8 11:02 | ||
| 120 | + */ | ||
| 121 | + public function pv_ip(&$arr,$start,$end,$project_id){ | ||
| 122 | + $pv_ip = DB::table('gl_count') | ||
| 123 | + ->where(['project_id'=>$project_id]) | ||
| 124 | + ->where('date','>=',$start.' 00:00:00') | ||
| 125 | + ->where('date','<=',$end.' 23:59:59') | ||
| 126 | + ->select(DB::raw('SUM(pv_num) as pv_num'), DB::raw('SUM(ip_num) as ip_num'),DB::raw('SUM(inquiry_num) as inquiry_num')) | ||
| 127 | + ->first(); | ||
| 128 | + $arr['pv'] = $pv_ip->pv_num; | ||
| 129 | + $arr['ip'] = $pv_ip->ip_num; | ||
| 130 | + if($arr['ip'] != 0){ | ||
| 131 | + $arr['rate'] = round((($arr['month_total'] ?? 0) / $arr['ip']) * 10,2); | ||
| 132 | + } | ||
| 133 | + return $arr; | ||
| 134 | + } | ||
| 135 | + /** | ||
| 136 | + * @remark :来源访问前8 | ||
| 137 | + * @name :sourceCount | ||
| 138 | + * @author :lyh | ||
| 139 | + * @method :post | ||
| 140 | + * @time :2023/6/30 16:14 | ||
| 141 | + */ | ||
| 142 | + public function sourceCount(&$arr,$startTime,$endTime){ | ||
| 143 | + //访问来源前10 | ||
| 144 | + $source = DB::connection('custom_mysql')->table('gl_customer_visit') | ||
| 145 | + ->select('referrer_url', DB::raw('COUNT(*) as count')) | ||
| 146 | + ->groupBy('referrer_url') | ||
| 147 | + ->whereBetween('updated_date', [$startTime,$endTime]) | ||
| 148 | + ->orderByDesc('count')->limit(10)->get()->toArray(); | ||
| 149 | + $arr['source'] = json_encode($source); | ||
| 150 | + //访问国家前15 | ||
| 151 | + $source_country = DB::connection('custom_mysql')->table('gl_customer_visit') | ||
| 152 | + ->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv')) | ||
| 153 | + ->groupBy('country') | ||
| 154 | + ->whereBetween('updated_date', [$startTime,$endTime]) | ||
| 155 | + ->orderBy('ip','desc')->limit(15)->get()->toArray(); | ||
| 156 | + $arr['source_country'] = json_encode($source_country); | ||
| 157 | + //受访界面前15 | ||
| 158 | + $referrer_url = DB::connection('custom_mysql')->table('gl_customer_visit') | ||
| 159 | + ->select('url',DB::raw('COUNT(*) as num')) | ||
| 160 | + ->orderBy('num','desc') | ||
| 161 | + ->whereBetween('updated_date', [$startTime,$endTime]) | ||
| 162 | + ->groupBy('url') | ||
| 163 | + ->limit(15)->get()->toArray(); | ||
| 164 | + $arr['referrer_url'] = json_encode($referrer_url); | ||
| 165 | + //访问端口 | ||
| 166 | + $referrer_port = DB::connection('custom_mysql')->table('gl_customer_visit') | ||
| 167 | + ->select('device_port',DB::raw('COUNT(*) as num')) | ||
| 168 | + ->orderBy('num','desc') | ||
| 169 | + ->whereBetween('updated_date', [$startTime,$endTime]) | ||
| 170 | + ->groupBy('device_port') | ||
| 171 | + ->limit(15)->get()->toArray(); | ||
| 172 | + $arr['referrer_port'] = json_encode($referrer_port); | ||
| 173 | + return $arr; | ||
| 174 | + } | ||
| 175 | + | ||
| 176 | + public function inquiry($url,$month){ | ||
| 177 | + $url = 'https://'.$url.'/'; | ||
| 178 | + $token = md5($url.date("Y-m-d")); | ||
| 179 | + $url = 'https://form.globalso.com/api/external-interface/country_con/15243d63ed5a5738?domain='.$url.'&token='.$token.'&source=1,2,3,4&model=month&sta_date='.$month; | ||
| 180 | + $res = http_get($url,['charset=utf-8']); | ||
| 181 | + echo date('Y-m-d H:i:s') . '数据:'.json_encode($res) . PHP_EOL; | ||
| 182 | + return $res; | ||
| 183 | + } | ||
| 184 | + | ||
| 185 | +} |
| @@ -55,7 +55,7 @@ class UpdateRoute extends Command | @@ -55,7 +55,7 @@ class UpdateRoute extends Command | ||
| 55 | */ | 55 | */ |
| 56 | public function handle(){ | 56 | public function handle(){ |
| 57 | $projectModel = new Project(); | 57 | $projectModel = new Project(); |
| 58 | - $list = $projectModel->list(['id'=>264]); | 58 | + $list = $projectModel->list(['id'=>358]); |
| 59 | $data = []; | 59 | $data = []; |
| 60 | foreach ($list as $v){ | 60 | foreach ($list as $v){ |
| 61 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | 61 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; |
| @@ -7,13 +7,16 @@ use App\Helper\Common; | @@ -7,13 +7,16 @@ use App\Helper\Common; | ||
| 7 | use App\Helper\Gpt; | 7 | use App\Helper\Gpt; |
| 8 | use App\Helper\Translate; | 8 | use App\Helper\Translate; |
| 9 | use App\Models\Ai\AiCommand; | 9 | use App\Models\Ai\AiCommand; |
| 10 | +use App\Models\Domain\DomainInfo; | ||
| 10 | use App\Models\Mail\Mail; | 11 | use App\Models\Mail\Mail; |
| 12 | +use App\Models\Project\DeployBuild; | ||
| 11 | use App\Models\Project\DeployOptimize; | 13 | use App\Models\Project\DeployOptimize; |
| 12 | use App\Models\Project\ProjectUpdateTdk; | 14 | use App\Models\Project\ProjectUpdateTdk; |
| 13 | use App\Models\User\User; | 15 | use App\Models\User\User; |
| 14 | use App\Models\WebSetting\WebLanguage; | 16 | use App\Models\WebSetting\WebLanguage; |
| 15 | use App\Services\ProjectServer; | 17 | use App\Services\ProjectServer; |
| 16 | use Illuminate\Console\Command; | 18 | use Illuminate\Console\Command; |
| 19 | +use Illuminate\Http\Request; | ||
| 17 | use Illuminate\Support\Facades\Cache; | 20 | use Illuminate\Support\Facades\Cache; |
| 18 | use Illuminate\Support\Facades\DB; | 21 | use Illuminate\Support\Facades\DB; |
| 19 | use Illuminate\Support\Facades\Redis; | 22 | use Illuminate\Support\Facades\Redis; |
| @@ -149,6 +152,8 @@ class UpdateSeoTdk extends Command | @@ -149,6 +152,8 @@ class UpdateSeoTdk extends Command | ||
| 149 | try { | 152 | try { |
| 150 | $this->project = ProjectServer::useProject($project_id); | 153 | $this->project = ProjectServer::useProject($project_id); |
| 151 | $this->seo_tdk($project_id, $task->id); | 154 | $this->seo_tdk($project_id, $task->id); |
| 155 | + //TODO::通知C端更新所有界面 | ||
| 156 | + $this->sendNotify($project_id); | ||
| 152 | DB::disconnect('custom_mysql'); | 157 | DB::disconnect('custom_mysql'); |
| 153 | }catch (\Exception $e){ | 158 | }catch (\Exception $e){ |
| 154 | echo date('Y-m-d H:i:s') . 'line: '. $e->getLine() .' error: ' . $project_id . '->' . $e->getMessage() . PHP_EOL; | 159 | echo date('Y-m-d H:i:s') . 'line: '. $e->getLine() .' error: ' . $project_id . '->' . $e->getMessage() . PHP_EOL; |
| @@ -158,7 +163,30 @@ class UpdateSeoTdk extends Command | @@ -158,7 +163,30 @@ class UpdateSeoTdk extends Command | ||
| 158 | echo date('Y-m-d H:i:s') . ' end project_id: ' . $project_id . PHP_EOL; | 163 | echo date('Y-m-d H:i:s') . ' end project_id: ' . $project_id . PHP_EOL; |
| 159 | } | 164 | } |
| 160 | } | 165 | } |
| 161 | - | 166 | + public function sendNotify($project_id) |
| 167 | + { | ||
| 168 | + //获取当前项目的域名 | ||
| 169 | + $domainModel = new DomainInfo(); | ||
| 170 | + $domainInfo = $domainModel->read(['project_id'=>$project_id]); | ||
| 171 | + if($domainInfo === false){ | ||
| 172 | + //获取测试域名 | ||
| 173 | + $deployBuildModel = new DeployBuild(); | ||
| 174 | + $buildInfo = $deployBuildModel->read(['project_id'=>$project_id]); | ||
| 175 | + $this->param['domain'] = $buildInfo['test_domain']; | ||
| 176 | + }else{ | ||
| 177 | + $this->param['domain'] = 'https://'.$domainInfo['domain'].'/'; | ||
| 178 | + } | ||
| 179 | + $url = $this->param['domain'].'api/update_page/'; | ||
| 180 | + $param = [ | ||
| 181 | + 'project_id' => $project_id, | ||
| 182 | + 'type' => 1, | ||
| 183 | + 'route' => 1, | ||
| 184 | + 'url' => [], | ||
| 185 | + 'language'=> [], | ||
| 186 | + ]; | ||
| 187 | + http_post($url, json_encode($param)); | ||
| 188 | + echo '更新中请稍后, 更新完成将会发送站内信通知更新结果!'. PHP_EOL; | ||
| 189 | + } | ||
| 162 | public function seo_tdk($project_id, $task_id) | 190 | public function seo_tdk($project_id, $task_id) |
| 163 | { | 191 | { |
| 164 | 192 |
| @@ -149,7 +149,7 @@ class WebTrafficRussia extends Command | @@ -149,7 +149,7 @@ class WebTrafficRussia extends Command | ||
| 149 | * 概率值 | 149 | * 概率值 |
| 150 | * @var int[] | 150 | * @var int[] |
| 151 | */ | 151 | */ |
| 152 | - protected $sjjg = [360, 640];//访问间隔占比 访问|不访问 比非俄语站降一般 | 152 | + protected $sjjg = [360, 640];//访问间隔占比 访问|不访问 比非俄语站降一半 |
| 153 | //访问页面类型占比 产品详情页、单页|产品分类页 | 153 | //访问页面类型占比 产品详情页、单页|产品分类页 |
| 154 | protected $ymzb = [ | 154 | protected $ymzb = [ |
| 155 | 'urls_cats' => 700, | 155 | 'urls_cats' => 700, |
| @@ -53,7 +53,7 @@ class WebTrafficRussiaSpecial extends Command | @@ -53,7 +53,7 @@ class WebTrafficRussiaSpecial extends Command | ||
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | protected $projects = [ | 55 | protected $projects = [ |
| 56 | - 969 => 30, | 56 | + 969 => 60, |
| 57 | ]; | 57 | ]; |
| 58 | 58 | ||
| 59 | /** | 59 | /** |
| @@ -289,7 +289,7 @@ class WebTrafficRussiaSpecial extends Command | @@ -289,7 +289,7 @@ class WebTrafficRussiaSpecial extends Command | ||
| 289 | 'referrer_url' => $this->getReferer($ips[$project_key]['ip_area'], $project['lang']), | 289 | 'referrer_url' => $this->getReferer($ips[$project_key]['ip_area'], $project['lang']), |
| 290 | 'user_agent' => $project['user_agent'], | 290 | 'user_agent' => $project['user_agent'], |
| 291 | ]; | 291 | ]; |
| 292 | - Log::channel('traffic')->info('ru_traffic project_id:' . $project['project_id'], $data); | 292 | + Log::channel('traffic')->info('ru_traffic_special project_id:' . $project['project_id'], $data); |
| 293 | $promises[] = $client->postAsync($project['domain'] . 'api/traffic_visit', ['form_params' => $data]); | 293 | $promises[] = $client->postAsync($project['domain'] . 'api/traffic_visit', ['form_params' => $data]); |
| 294 | } | 294 | } |
| 295 | 295 |
| @@ -33,6 +33,7 @@ class OptimizeController extends BaseController | @@ -33,6 +33,7 @@ class OptimizeController extends BaseController | ||
| 33 | public function lists(Project $project){ | 33 | public function lists(Project $project){ |
| 34 | $query = $project->leftJoin('gl_project_payment', 'gl_project.id', '=', 'gl_project_payment.project_id') | 34 | $query = $project->leftJoin('gl_project_payment', 'gl_project.id', '=', 'gl_project_payment.project_id') |
| 35 | ->leftJoin('gl_project_deploy_build', 'gl_project.id', '=', 'gl_project_deploy_build.project_id') | 35 | ->leftJoin('gl_project_deploy_build', 'gl_project.id', '=', 'gl_project_deploy_build.project_id') |
| 36 | + ->leftJoin('gl_domain_info', 'gl_project.id', '=', 'gl_domain_info.project_id') | ||
| 36 | ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id') | 37 | ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id') |
| 37 | ->leftJoin('gl_project_online_check', 'gl_project.id', '=', 'gl_project_online_check.project_id'); | 38 | ->leftJoin('gl_project_online_check', 'gl_project.id', '=', 'gl_project_online_check.project_id'); |
| 38 | $query = $this->searchParam($query)->orderByRaw("FIELD(gl_project.level, '2') DESC") | 39 | $query = $this->searchParam($query)->orderByRaw("FIELD(gl_project.level, '2') DESC") |
| @@ -131,8 +132,10 @@ class OptimizeController extends BaseController | @@ -131,8 +132,10 @@ class OptimizeController extends BaseController | ||
| 131 | $item['plan'] = Project::planMap()[$item['plan']]; | 132 | $item['plan'] = Project::planMap()[$item['plan']]; |
| 132 | $item['created_at'] = date('Y年m月d日', strtotime($item['cooperate_date'])); | 133 | $item['created_at'] = date('Y年m月d日', strtotime($item['cooperate_date'])); |
| 133 | $item['autologin_code'] = getAutoLoginCode($item['id']); | 134 | $item['autologin_code'] = getAutoLoginCode($item['id']); |
| 134 | - $domainModel = new DomainInfo(); | ||
| 135 | - $item['domain'] = !empty($item['domain']) ? $domainModel->getDomain($item['domain']) : ''; | 135 | + $item['domain'] = 'https://'.$item['domain'].'/'; |
| 136 | + if(!empty($item['domain']) && $item['amp_status'] == 1){ | ||
| 137 | + $item['amp_domain'] = str_replace('www','m',$item['domain']); | ||
| 138 | + } | ||
| 136 | $item['product_num'] = $data['product'] ?? 0; | 139 | $item['product_num'] = $data['product'] ?? 0; |
| 137 | $item['keyword_num'] = $item['key'] ?? 0; | 140 | $item['keyword_num'] = $item['key'] ?? 0; |
| 138 | $item['autologin_code'] = getAutoLoginCode($item['id']); | 141 | $item['autologin_code'] = getAutoLoginCode($item['id']); |
| @@ -186,11 +189,12 @@ class OptimizeController extends BaseController | @@ -186,11 +189,12 @@ class OptimizeController extends BaseController | ||
| 186 | 'gl_project_deploy_optimize.tech_mid AS optimize_tech_mid', | 189 | 'gl_project_deploy_optimize.tech_mid AS optimize_tech_mid', |
| 187 | 'gl_project_deploy_optimize.design_mid AS design_mid', | 190 | 'gl_project_deploy_optimize.design_mid AS design_mid', |
| 188 | 'gl_project_deploy_optimize.tech_leader AS tech_leader', | 191 | 'gl_project_deploy_optimize.tech_leader AS tech_leader', |
| 189 | - 'gl_project_deploy_optimize.domain AS domain', | ||
| 190 | 'gl_project_deploy_optimize.quality_mid AS quality_mid', | 192 | 'gl_project_deploy_optimize.quality_mid AS quality_mid', |
| 191 | 'gl_project_deploy_optimize.design_mid AS design_mid', | 193 | 'gl_project_deploy_optimize.design_mid AS design_mid', |
| 192 | 'gl_project_deploy_optimize.start_date AS start_date', | 194 | 'gl_project_deploy_optimize.start_date AS start_date', |
| 193 | 'gl_project_deploy_optimize.backlink AS backlink', | 195 | 'gl_project_deploy_optimize.backlink AS backlink', |
| 196 | + 'gl_domain_info.amp_status AS amp_status', | ||
| 197 | + 'gl_domain_info.domain AS domain', | ||
| 194 | ]; | 198 | ]; |
| 195 | return $select; | 199 | return $select; |
| 196 | } | 200 | } |
| @@ -246,8 +250,8 @@ class OptimizeController extends BaseController | @@ -246,8 +250,8 @@ class OptimizeController extends BaseController | ||
| 246 | if(isset($this->map['domain']) && !empty($this->map['domain'])){ | 250 | if(isset($this->map['domain']) && !empty($this->map['domain'])){ |
| 247 | $parsedUrl = parse_url($this->map['domain']); | 251 | $parsedUrl = parse_url($this->map['domain']); |
| 248 | $this->map['domain'] = $parsedUrl['host'] ?? $this->map['domain']; | 252 | $this->map['domain'] = $parsedUrl['host'] ?? $this->map['domain']; |
| 249 | - $ids = DomainInfo::where('domain', 'like', '%'.$this->map['domain'].'%')->pluck('id')->toArray(); | ||
| 250 | - $query = $query->whereIn('gl_project_deploy_optimize.domain', $ids); | 253 | +// $ids = DomainInfo::where('domain', 'like', '%'.$this->map['domain'].'%')->pluck('id')->toArray(); |
| 254 | + $query = $query->where('gl_domain_info.domain', 'like' ,'%'.$this->map['domain'].'%'); | ||
| 251 | } | 255 | } |
| 252 | if(isset($this->map['test_domain']) && !empty($this->map['test_domain'])){ | 256 | if(isset($this->map['test_domain']) && !empty($this->map['test_domain'])){ |
| 253 | $query = $query->where('gl_project_deploy_build.test_domain','like','%'.$this->map['test_domain'].'%'); | 257 | $query = $query->where('gl_project_deploy_build.test_domain','like','%'.$this->map['test_domain'].'%'); |
| @@ -397,7 +397,7 @@ class ProjectLogic extends BaseLogic | @@ -397,7 +397,7 @@ class ProjectLogic extends BaseLogic | ||
| 397 | $info = $this->model->read(['id'=>$param['id']]); | 397 | $info = $this->model->read(['id'=>$param['id']]); |
| 398 | if($info['delete_status'] == 0){ | 398 | if($info['delete_status'] == 0){ |
| 399 | //删除原始项目 | 399 | //删除原始项目 |
| 400 | - $this->edit(['delete_status' => 1], ['id' => $param['id']]); | 400 | + $this->edit(['delete_status' => 1,'type'=>$param['type']], ['id' => $param['id']]); |
| 401 | //添加到续费单 | 401 | //添加到续费单 |
| 402 | $data = [ | 402 | $data = [ |
| 403 | 'title' => '【续费单】' . $param['title'], | 403 | 'title' => '【续费单】' . $param['title'], |
| @@ -411,8 +411,8 @@ class ProjectLogic extends BaseLogic | @@ -411,8 +411,8 @@ class ProjectLogic extends BaseLogic | ||
| 411 | 'service_duration' => $param['deploy_build']['service_duration'], | 411 | 'service_duration' => $param['deploy_build']['service_duration'], |
| 412 | 'plan' => $param['deploy_build']['plan'], | 412 | 'plan' => $param['deploy_build']['plan'], |
| 413 | 'amount' => $param['payment']['amount'], | 413 | 'amount' => $param['payment']['amount'], |
| 414 | - 'contract' => json_encode($param['payment']['contract']), | ||
| 415 | - 'bill' => json_encode($param['payment']['bill']), | 414 | + 'contract' => json_encode($param['payment']['contract'] ?? []), |
| 415 | + 'bill' => json_encode($param['payment']['bill'] ?? []), | ||
| 416 | ]; | 416 | ]; |
| 417 | $renewModel = new ProjectRenew(); | 417 | $renewModel = new ProjectRenew(); |
| 418 | $renewModel->add($data); | 418 | $renewModel->add($data); |
| @@ -58,6 +58,25 @@ class SyncSubmitTaskService | @@ -58,6 +58,25 @@ class SyncSubmitTaskService | ||
| 58 | 58 | ||
| 59 | 59 | ||
| 60 | /** | 60 | /** |
| 61 | + * 特殊处理项目 去掉来源url的全部参数 | ||
| 62 | + */ | ||
| 63 | + public function handle_referer($referer){ | ||
| 64 | + $url = [ | ||
| 65 | + 'www.shphe.ru', | ||
| 66 | + 'www.mainpaper.ru', | ||
| 67 | + 'www.jinbiao.ru', | ||
| 68 | + 'www.gyhockey.ru', | ||
| 69 | + ]; | ||
| 70 | + | ||
| 71 | + if(Str::contains($referer, $url)){ | ||
| 72 | + $referer = pathinfo($referer,PATHINFO_DIRNAME); | ||
| 73 | + } | ||
| 74 | + return $referer; | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + | ||
| 78 | + | ||
| 79 | + /** | ||
| 61 | * 询盘 | 80 | * 询盘 |
| 62 | * @param $data | 81 | * @param $data |
| 63 | * @return bool | 82 | * @return bool |
| @@ -75,6 +94,8 @@ class SyncSubmitTaskService | @@ -75,6 +94,8 @@ class SyncSubmitTaskService | ||
| 75 | 94 | ||
| 76 | $form_id = InquiryForm::getFromId($data['data']); | 95 | $form_id = InquiryForm::getFromId($data['data']); |
| 77 | 96 | ||
| 97 | + $data['referer'] = $this->handle_referer($data['referer']); | ||
| 98 | + | ||
| 78 | InquiryFormData::saveData($form_id, $data['domain'], $data['ip'], $data['country'], $data['referer'], $data['user_agent'], $data['submit_at'], $data['data']); | 99 | InquiryFormData::saveData($form_id, $data['domain'], $data['ip'], $data['country'], $data['referer'], $data['user_agent'], $data['submit_at'], $data['data']); |
| 79 | 100 | ||
| 80 | //转化询盘 | 101 | //转化询盘 |
| @@ -102,7 +123,7 @@ class SyncSubmitTaskService | @@ -102,7 +123,7 @@ class SyncSubmitTaskService | ||
| 102 | $referrer_url = $url_arr['scheme'] . '://' . $url_arr['host'] . '/'; | 123 | $referrer_url = $url_arr['scheme'] . '://' . $url_arr['host'] . '/'; |
| 103 | } | 124 | } |
| 104 | } | 125 | } |
| 105 | - $visit_data['referrer_url'] = $referrer_url; | 126 | + $visit_data['referrer_url'] = $this->handle_referer($referrer_url); |
| 106 | $visit_data['device_port'] = $data['data']['device_port']??''; | 127 | $visit_data['device_port'] = $data['data']['device_port']??''; |
| 107 | $visit_data['url'] = $data['data']['url']??''; | 128 | $visit_data['url'] = $data['data']['url']??''; |
| 108 | $visit_data['domain'] = $data['domain']??''; | 129 | $visit_data['domain'] = $data['domain']??''; |
| @@ -14,8 +14,8 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -14,8 +14,8 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 14 | Route::any('/editPassword', [Aside\Com\IndexController::class, 'editPassword'])->name('admin.editPassword.white'); | 14 | Route::any('/editPassword', [Aside\Com\IndexController::class, 'editPassword'])->name('admin.editPassword.white'); |
| 15 | Route::get('/logout', [Aside\LoginController::class, 'logout'])->name('admin.logout.white'); | 15 | Route::get('/logout', [Aside\LoginController::class, 'logout'])->name('admin.logout.white'); |
| 16 | Route::any('/getAccessAddress', [Aside\LoginController::class, 'getAccessAddress'])->name('admin.getAccessAddress');//获取B端地址 | 16 | Route::any('/getAccessAddress', [Aside\LoginController::class, 'getAccessAddress'])->name('admin.getAccessAddress');//获取B端地址 |
| 17 | - Route::get('/sendNotify', [Aside\Com\CNoticeController::class, 'sendNotify'])->name('admin.sendNotify'); | ||
| 18 | - Route::get('/getCountry', [Aside\Com\CNoticeController::class, 'getCountry'])->name('admin.getCountry'); | 17 | + Route::any('/sendNotify', [Aside\Com\CNoticeController::class, 'sendNotify'])->name('admin.sendNotify'); |
| 18 | + Route::any('/getCountry', [Aside\Com\CNoticeController::class, 'getCountry'])->name('admin.getCountry'); | ||
| 19 | 19 | ||
| 20 | //会员相关 | 20 | //会员相关 |
| 21 | Route::prefix('user')->group(function () { | 21 | Route::prefix('user')->group(function () { |
-
请 注册 或 登录 后发表评论