作者 lyh

gx

@@ -11,6 +11,7 @@ namespace App\Console\Commands\LyhTest; @@ -11,6 +11,7 @@ namespace App\Console\Commands\LyhTest;
11 11
12 use App\Helper\Arr; 12 use App\Helper\Arr;
13 use App\Helper\Translate; 13 use App\Helper\Translate;
  14 +use App\Models\Ai\AiBlog;
14 use App\Models\Blog\Blog; 15 use App\Models\Blog\Blog;
15 use App\Models\CustomModule\CustomModuleContent; 16 use App\Models\CustomModule\CustomModuleContent;
16 use App\Models\Product\CategoryRelated; 17 use App\Models\Product\CategoryRelated;
@@ -60,16 +61,33 @@ class UpdateRoute extends Command @@ -60,16 +61,33 @@ class UpdateRoute extends Command
60 * @method :post 61 * @method :post
61 * @time :2023/11/20 15:13 62 * @time :2023/11/20 15:13
62 */ 63 */
63 - public function handle(){ 64 + public function handle()
  65 + {
64 $projectModel = new Project(); 66 $projectModel = new Project();
65 - $lists = $projectModel->list(['delete_status'=>0],'id',['id']);  
66 - foreach ($lists as $v){  
67 - echo date('Y-m-d H:i:s') . '执行项目的project_id:'.$v['id'] . PHP_EOL; 67 + $lists = $projectModel->list(['delete_status' => 0], 'id', ['id']);
  68 + echo date('Y-m-d H:i:s') . '开始--------------' . PHP_EOL;
  69 + foreach ($lists as $v) {
68 ProjectServer::useProject($v['id']); 70 ProjectServer::useProject($v['id']);
69 - $this->updateSeo(); 71 + $this->getAiBlog($v['id']);
70 DB::disconnect('custom_mysql'); 72 DB::disconnect('custom_mysql');
71 } 73 }
72 - 74 + echo date('Y-m-d H:i:s') . '--------------结束' . PHP_EOL;
  75 + }
  76 + /**
  77 + * @remark :
  78 + * @name :getAiBlog
  79 + * @author :lyh
  80 + * @method :post
  81 + * @time :2025/3/21 17:45
  82 + */
  83 + public function getAiBlog($project_id){
  84 + $aiBlogModel = new AiBlog();
  85 + $lists = $aiBlogModel->list(['updated_at'=>['<=','2025-03-21 00:00:00']]);
  86 + if(!empty($lists)){
  87 + echo date('Y-m-d H:i:s') . '有任务未执行的project_id:'.$project_id . PHP_EOL;
  88 + }
  89 + return true;
  90 + }
73 91
74 // $this->updateProjectOp(); 92 // $this->updateProjectOp();
75 // $projectModel = new Project(); 93 // $projectModel = new Project();
@@ -94,8 +112,8 @@ class UpdateRoute extends Command @@ -94,8 +112,8 @@ class UpdateRoute extends Command
94 // } 112 // }
95 // DB::disconnect('custom_mysql'); 113 // DB::disconnect('custom_mysql');
96 // } 114 // }
97 - echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;  
98 - } 115 +// echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
  116 +// }
99 117
100 /** 118 /**
101 * @remark :更新产品 119 * @remark :更新产品