Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate
正在显示
9 个修改的文件
包含
133 行增加
和
30 行删除
| @@ -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 | } |
| @@ -141,7 +141,7 @@ class KeywordVideoController extends BaseController | @@ -141,7 +141,7 @@ class KeywordVideoController extends BaseController | ||
| 141 | 'project_id.required' => '项目唯一标识不为空', | 141 | 'project_id.required' => '项目唯一标识不为空', |
| 142 | ]); | 142 | ]); |
| 143 | $taskLogModel = new KeywordVideoTaskLog(); | 143 | $taskLogModel = new KeywordVideoTaskLog(); |
| 144 | - $list = $taskLogModel->list($this->map); | 144 | + $list = $taskLogModel->lists($this->map,$this->page,$this->row); |
| 145 | $this->response('success',Code::SUCCESS,$list); | 145 | $this->response('success',Code::SUCCESS,$list); |
| 146 | } | 146 | } |
| 147 | 147 |
| @@ -324,4 +324,31 @@ class ComController extends BaseController | @@ -324,4 +324,31 @@ class ComController extends BaseController | ||
| 324 | Cache::add('login-project-'.$this->user['mobile'],1,300); | 324 | Cache::add('login-project-'.$this->user['mobile'],1,300); |
| 325 | $this->response('success',Code::SUCCESS,$data); | 325 | $this->response('success',Code::SUCCESS,$data); |
| 326 | } | 326 | } |
| 327 | + | ||
| 328 | + /** | ||
| 329 | + * @remark :推荐采购商 | ||
| 330 | + * @name :recommendedPurchaser | ||
| 331 | + * @author :lyh | ||
| 332 | + * @method :post | ||
| 333 | + * @time :2024/3/4 10:10 | ||
| 334 | + */ | ||
| 335 | + public function recommendedPurchaser(){ | ||
| 336 | + $this->param['keyword'] = 'led'; | ||
| 337 | + $url = 'https://admin.hagro.cn/api/company_list'; | ||
| 338 | + $data = [ | ||
| 339 | + 'prod_desc'=>$this->param['keyword'], | ||
| 340 | + 'total'=>$this->param['now'] ?? 10, | ||
| 341 | + ]; | ||
| 342 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export(http_build_query($data), true) . PHP_EOL, FILE_APPEND); | ||
| 343 | + $token = 'company_list'.date('Y-m-d').http_build_query(arsort($data)); | ||
| 344 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($token, true) . PHP_EOL, FILE_APPEND); | ||
| 345 | + $param = [ | ||
| 346 | + 'prod_desc'=>$this->param['keyword'], | ||
| 347 | + 'token'=>$token, | ||
| 348 | + 'total'=>$this->param['now'] ?? 10, | ||
| 349 | + ]; | ||
| 350 | + $lists = http_post($url,$param); | ||
| 351 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($token, true) . PHP_EOL, FILE_APPEND); | ||
| 352 | + $this->response('success',Code::SUCCESS,$lists); | ||
| 353 | + } | ||
| 327 | } | 354 | } |
| @@ -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; |
app/Jobs/PurchaserJob.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :PurchaserJob.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2024/3/4 11:06 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Jobs; | ||
| 11 | + | ||
| 12 | +use Illuminate\Bus\Queueable; | ||
| 13 | +use Illuminate\Contracts\Queue\ShouldQueue; | ||
| 14 | +use Illuminate\Foundation\Bus\Dispatchable; | ||
| 15 | +use Illuminate\Queue\InteractsWithQueue; | ||
| 16 | +use Illuminate\Queue\SerializesModels; | ||
| 17 | + | ||
| 18 | +class PurchaserJob implements ShouldQueue | ||
| 19 | +{ | ||
| 20 | + use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; | ||
| 21 | + public $tries = 3; // 可配置任务重试次数 | ||
| 22 | + | ||
| 23 | + protected $param; | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * Create a new job instance. | ||
| 27 | + * | ||
| 28 | + * @param CopyImageFile $event | ||
| 29 | + * @return void | ||
| 30 | + */ | ||
| 31 | + public function __construct($data) | ||
| 32 | + { | ||
| 33 | + $this->param = $data; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * Handle the event. | ||
| 38 | + * | ||
| 39 | + * @param UpdateHtml $event | ||
| 40 | + * @return void | ||
| 41 | + */ | ||
| 42 | + public function handle() | ||
| 43 | + { | ||
| 44 | + | ||
| 45 | + } | ||
| 46 | +} |
| @@ -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 | //无需登录验证的路由组 |
| @@ -20,6 +20,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -20,6 +20,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 20 | Route::any('/generateToken', [\App\Http\Controllers\Bside\BCom\ComController::class, 'generateToken'])->name('generateToken'); | 20 | Route::any('/generateToken', [\App\Http\Controllers\Bside\BCom\ComController::class, 'generateToken'])->name('generateToken'); |
| 21 | Route::any('/getLink', [\App\Http\Controllers\Bside\BCom\ComController::class, 'getLink'])->name('getLink'); | 21 | Route::any('/getLink', [\App\Http\Controllers\Bside\BCom\ComController::class, 'getLink'])->name('getLink'); |
| 22 | Route::any('/getMobileProject', [\App\Http\Controllers\Bside\BCom\ComController::class, 'getMobileProject'])->name('getMobileProject'); | 22 | Route::any('/getMobileProject', [\App\Http\Controllers\Bside\BCom\ComController::class, 'getMobileProject'])->name('getMobileProject'); |
| 23 | + Route::any('/recommendedPurchaser', [\App\Http\Controllers\Bside\BCom\ComController::class, 'recommendedPurchaser'])->name('recommendedPurchaser'); | ||
| 23 | //用户相关路由 | 24 | //用户相关路由 |
| 24 | Route::prefix('user')->group(function () { | 25 | Route::prefix('user')->group(function () { |
| 25 | Route::any('/', [\App\Http\Controllers\Bside\User\UserController::class, 'lists'])->name('user_lists'); | 26 | Route::any('/', [\App\Http\Controllers\Bside\User\UserController::class, 'lists'])->name('user_lists'); |
-
请 注册 或 登录 后发表评论