Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
5 个修改的文件
包含
58 行增加
和
29 行删除
| @@ -43,6 +43,7 @@ class RankData extends BaseCommands | @@ -43,6 +43,7 @@ class RankData extends BaseCommands | ||
| 43 | */ | 43 | */ |
| 44 | public function do() | 44 | public function do() |
| 45 | { | 45 | { |
| 46 | + Log::channel('rank_data')->info('开始-排名数据'); | ||
| 46 | //同步api_no | 47 | //同步api_no |
| 47 | $this->SyncApiNo(); | 48 | $this->SyncApiNo(); |
| 48 | 49 |
| @@ -103,4 +103,21 @@ class IndexController extends BaseController | @@ -103,4 +103,21 @@ class IndexController extends BaseController | ||
| 103 | } | 103 | } |
| 104 | $this->response('success'); | 104 | $this->response('success'); |
| 105 | } | 105 | } |
| 106 | + | ||
| 107 | + /** | ||
| 108 | + * 生成嵌套AICC企微的token | ||
| 109 | + * @author zbj | ||
| 110 | + * @date 2024/2/29 | ||
| 111 | + */ | ||
| 112 | + public function generateAiCCToken(){ | ||
| 113 | + $data = [ | ||
| 114 | + 'id' => $this->manage['id'], | ||
| 115 | + 'name' => $this->manage['name'], | ||
| 116 | + 'timestamp' => time(), // 接收到字符串解密出来以后需要 验证时间不超过30秒 超过时间视为无效授权 | ||
| 117 | + ]; | ||
| 118 | + $common = new \App\Helper\Common(); | ||
| 119 | + $str = $common->encrypt($data); | ||
| 120 | + $this->response('success',Code::SUCCESS,['str'=>$str]); | ||
| 121 | + } | ||
| 122 | + | ||
| 106 | } | 123 | } |
| @@ -152,7 +152,7 @@ class DomainInfoLogic extends BaseLogic | @@ -152,7 +152,7 @@ class DomainInfoLogic extends BaseLogic | ||
| 152 | * @author Akun | 152 | * @author Akun |
| 153 | * @date 2023/10/17 11:52 | 153 | * @date 2023/10/17 11:52 |
| 154 | */ | 154 | */ |
| 155 | - public function setDomainSsl($initDomain,$domain,$rewrite,$other_domain) | 155 | + public function setDomainSsl($initDomain,$domain,$rewrite,$other_domain,$is_https) |
| 156 | { | 156 | { |
| 157 | if($this->param['type'] == 2){ | 157 | if($this->param['type'] == 2){ |
| 158 | if(empty($this->param['key'])){ | 158 | if(empty($this->param['key'])){ |
| @@ -167,11 +167,17 @@ class DomainInfoLogic extends BaseLogic | @@ -167,11 +167,17 @@ class DomainInfoLogic extends BaseLogic | ||
| 167 | 'private_key' => $this->param['key'], | 167 | 'private_key' => $this->param['key'], |
| 168 | 'cert' => $this->param['cert'], | 168 | 'cert' => $this->param['cert'], |
| 169 | 'rewrite'=>$rewrite, | 169 | 'rewrite'=>$rewrite, |
| 170 | - 'other_domain'=>$other_domain | 170 | + 'other_domain'=>$other_domain, |
| 171 | + 'is_https' => $is_https | ||
| 171 | ]; | 172 | ]; |
| 172 | }else{ | 173 | }else{ |
| 173 | $api_url = 'http://'.$initDomain.'/api/applySsl'; | 174 | $api_url = 'http://'.$initDomain.'/api/applySsl'; |
| 174 | - $api_param = ['domain' => $domain,'rewrite'=>$rewrite,'other_domain'=>$other_domain]; | 175 | + $api_param = [ |
| 176 | + 'domain' => $domain, | ||
| 177 | + 'rewrite'=>$rewrite, | ||
| 178 | + 'other_domain'=>$other_domain, | ||
| 179 | + 'is_https' => $is_https | ||
| 180 | + ]; | ||
| 175 | } | 181 | } |
| 176 | try { | 182 | try { |
| 177 | $rs = HttpUtils::get($api_url, $api_param); | 183 | $rs = HttpUtils::get($api_url, $api_param); |
| @@ -287,6 +293,7 @@ class DomainInfoLogic extends BaseLogic | @@ -287,6 +293,7 @@ class DomainInfoLogic extends BaseLogic | ||
| 287 | 'type'=>$this->param['type'], | 293 | 'type'=>$this->param['type'], |
| 288 | 'private_key' => $this->param['key'] ?? '', | 294 | 'private_key' => $this->param['key'] ?? '', |
| 289 | 'private_cert' => $this->param['cert'] ?? '', | 295 | 'private_cert' => $this->param['cert'] ?? '', |
| 296 | + 'is_https' => $this->param['is_https'] ?? 0, | ||
| 290 | 'amp_status' => $this->param['amp_status'] ?? 0, | 297 | 'amp_status' => $this->param['amp_status'] ?? 0, |
| 291 | 'amp_type' => $this->param['amp_type'] ?? 0, | 298 | 'amp_type' => $this->param['amp_type'] ?? 0, |
| 292 | 'amp_private_key' => $this->param['amp_key'] ?? '', | 299 | 'amp_private_key' => $this->param['amp_key'] ?? '', |
| @@ -294,7 +301,7 @@ class DomainInfoLogic extends BaseLogic | @@ -294,7 +301,7 @@ class DomainInfoLogic extends BaseLogic | ||
| 294 | ]; | 301 | ]; |
| 295 | $this->model->edit($data,['id'=>$this->param['id']]); | 302 | $this->model->edit($data,['id'=>$this->param['id']]); |
| 296 | //生成证书 | 303 | //生成证书 |
| 297 | - $this->setDomainSsl($server_info['init_domain'],$info['domain'],$this->param['extend_config'] ?? [],$this->param['other_domain'] ?? []); | 304 | + $this->setDomainSsl($server_info['init_domain'],$info['domain'],$this->param['extend_config'] ?? [],$this->param['other_domain'] ?? [],$this->param['is_https'] ?? 0); |
| 298 | 305 | ||
| 299 | //amp站点生成证书 | 306 | //amp站点生成证书 |
| 300 | if($data['amp_status']){ | 307 | if($data['amp_status']){ |
| @@ -427,9 +427,8 @@ class RankDataLogic extends BaseLogic | @@ -427,9 +427,8 @@ class RankDataLogic extends BaseLogic | ||
| 427 | 427 | ||
| 428 | $first_num = $first_page_num = $first_three_pages_num = $first_five_pages_num = $first_ten_pages_num = 0; | 428 | $first_num = $first_page_num = $first_three_pages_num = $first_five_pages_num = $first_ten_pages_num = 0; |
| 429 | 429 | ||
| 430 | - if(!$lang){ | ||
| 431 | - foreach ($data as &$ranks){ | ||
| 432 | - ksort($ranks); | 430 | + foreach ($data as &$ranks){ |
| 431 | + ksort($ranks); | ||
| 433 | // foreach ($ranks as &$rank){ | 432 | // foreach ($ranks as &$rank){ |
| 434 | // //处理排名 | 433 | // //处理排名 |
| 435 | // if(!in_array($project_id, $without_project_ids)){ | 434 | // if(!in_array($project_id, $without_project_ids)){ |
| @@ -439,30 +438,30 @@ class RankDataLogic extends BaseLogic | @@ -439,30 +438,30 @@ class RankDataLogic extends BaseLogic | ||
| 439 | // //todo 需要特殊处理排名的项目 | 438 | // //todo 需要特殊处理排名的项目 |
| 440 | // } | 439 | // } |
| 441 | // } | 440 | // } |
| 442 | - $last = Arr::last($ranks); | ||
| 443 | - //第一名 | ||
| 444 | - if($last['position'] == 1){ | ||
| 445 | - $first_num ++; | ||
| 446 | - } | ||
| 447 | - //排名第一页 | ||
| 448 | - if($last['position'] > 0 && $last['position'] <= 10){ | ||
| 449 | - $first_page_num ++; | ||
| 450 | - } | ||
| 451 | - //排名前三页 | ||
| 452 | - if($last['position'] > 0 && $last['position'] <= 30){ | ||
| 453 | - $first_three_pages_num ++; | ||
| 454 | - } | ||
| 455 | - //排名前五页 | ||
| 456 | - if($last['position'] > 0 && $last['position'] <= 50){ | ||
| 457 | - $first_five_pages_num ++; | ||
| 458 | - } | ||
| 459 | - //排名前十页 | ||
| 460 | - if($last['position'] > 0 && $last['position'] <= 100){ | ||
| 461 | - $first_ten_pages_num ++; | ||
| 462 | - } | 441 | + $last = Arr::last($ranks); |
| 442 | + //第一名 | ||
| 443 | + if($last['position'] == 1){ | ||
| 444 | + $first_num ++; | ||
| 445 | + } | ||
| 446 | + //排名第一页 | ||
| 447 | + if($last['position'] > 0 && $last['position'] <= 10){ | ||
| 448 | + $first_page_num ++; | ||
| 449 | + } | ||
| 450 | + //排名前三页 | ||
| 451 | + if($last['position'] > 0 && $last['position'] <= 30){ | ||
| 452 | + $first_three_pages_num ++; | ||
| 453 | + } | ||
| 454 | + //排名前五页 | ||
| 455 | + if($last['position'] > 0 && $last['position'] <= 50){ | ||
| 456 | + $first_five_pages_num ++; | ||
| 457 | + } | ||
| 458 | + //排名前十页 | ||
| 459 | + if($last['position'] > 0 && $last['position'] <= 100){ | ||
| 460 | + $first_ten_pages_num ++; | ||
| 463 | } | 461 | } |
| 464 | } | 462 | } |
| 465 | 463 | ||
| 464 | + | ||
| 466 | $where = [ | 465 | $where = [ |
| 467 | 'project_id' => $project_id, | 466 | 'project_id' => $project_id, |
| 468 | 'lang' => $lang | 467 | 'lang' => $lang |
| @@ -473,12 +472,12 @@ class RankDataLogic extends BaseLogic | @@ -473,12 +472,12 @@ class RankDataLogic extends BaseLogic | ||
| 473 | } | 472 | } |
| 474 | 473 | ||
| 475 | //关键词达标天数 | 474 | //关键词达标天数 |
| 476 | - $model->is_compliance = 0; | ||
| 477 | if($model->updated_date != date('Y-m-d')){ | 475 | if($model->updated_date != date('Y-m-d')){ |
| 478 | //保证关键词数 | 476 | //保证关键词数 |
| 479 | $keyword_num = DeployBuild::where('project_id', $project_id)->value('keyword_num'); | 477 | $keyword_num = DeployBuild::where('project_id', $project_id)->value('keyword_num'); |
| 480 | $type = Project::where('id', $project_id)->value('type'); | 478 | $type = Project::where('id', $project_id)->value('type'); |
| 481 | if($keyword_num && $type == Project::TYPE_TWO && $first_page_num >= $keyword_num){ | 479 | if($keyword_num && $type == Project::TYPE_TWO && $first_page_num >= $keyword_num){ |
| 480 | + Log::channel('rank_data')->info('项目'.$project_id.':关键词达标-'.$first_page_num); | ||
| 482 | $model->compliance_day = $model->compliance_day + 1; | 481 | $model->compliance_day = $model->compliance_day + 1; |
| 483 | $model->is_compliance = 1; | 482 | $model->is_compliance = 1; |
| 484 | //项目表更新 | 483 | //项目表更新 |
| @@ -486,6 +485,8 @@ class RankDataLogic extends BaseLogic | @@ -486,6 +485,8 @@ class RankDataLogic extends BaseLogic | ||
| 486 | $compliance_day = Project::where(['id' => $project_id])->value('finish_remain_day') ?: 0; | 485 | $compliance_day = Project::where(['id' => $project_id])->value('finish_remain_day') ?: 0; |
| 487 | Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day+1]); | 486 | Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day+1]); |
| 488 | } | 487 | } |
| 488 | + }else{ | ||
| 489 | + Log::channel('rank_data')->info('项目'.$project_id.':关键词未达标-'.$first_page_num); | ||
| 489 | } | 490 | } |
| 490 | } | 491 | } |
| 491 | $model->project_id = $project_id; | 492 | $model->project_id = $project_id; |
| @@ -372,6 +372,9 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -372,6 +372,9 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 372 | Route::any('/del', [Aside\Template\ATemplateTypeController::class, 'del'])->name('admin.ATemplateType_del'); | 372 | Route::any('/del', [Aside\Template\ATemplateTypeController::class, 'del'])->name('admin.ATemplateType_del'); |
| 373 | }); | 373 | }); |
| 374 | }); | 374 | }); |
| 375 | + | ||
| 376 | + | ||
| 377 | + Route::any('/generate_aicc_token', [Aside\Com\IndexController::class, 'generateAiCCToken'])->name('admin.generate_aicc_token'); | ||
| 375 | }); | 378 | }); |
| 376 | 379 | ||
| 377 | //无需登录验证的路由组 | 380 | //无需登录验证的路由组 |
-
请 注册 或 登录 后发表评论