作者 李宇航

合并分支 'lyh-server' 到 'master'

gx



查看合并请求 !1542
... ... @@ -11,6 +11,7 @@ namespace App\Console\Commands\LyhTest;
use App\Helper\Arr;
use App\Helper\Translate;
use App\Models\Ai\AiBlog;
use App\Models\Blog\Blog;
use App\Models\CustomModule\CustomModuleContent;
use App\Models\Product\CategoryRelated;
... ... @@ -60,16 +61,33 @@ class UpdateRoute extends Command
* @method :post
* @time :2023/11/20 15:13
*/
public function handle(){
public function handle()
{
$projectModel = new Project();
$lists = $projectModel->list(['delete_status'=>0],'id',['id']);
foreach ($lists as $v){
echo date('Y-m-d H:i:s') . '执行项目的project_id:'.$v['id'] . PHP_EOL;
$lists = $projectModel->list(['delete_status' => 0], 'id', ['id']);
echo date('Y-m-d H:i:s') . '开始--------------' . PHP_EOL;
foreach ($lists as $v) {
ProjectServer::useProject($v['id']);
$this->updateSeo();
$this->getAiBlog($v['id']);
DB::disconnect('custom_mysql');
}
echo date('Y-m-d H:i:s') . '--------------结束' . PHP_EOL;
}
/**
* @remark :
* @name :getAiBlog
* @author :lyh
* @method :post
* @time :2025/3/21 17:45
*/
public function getAiBlog($project_id){
$aiBlogModel = new AiBlog();
$lists = $aiBlogModel->list(['updated_at'=>['<=','2025-03-21 00:00:00']]);
if(!empty($lists)){
echo date('Y-m-d H:i:s') . '有任务未执行的project_id:'.$project_id . PHP_EOL;
}
return true;
}
// $this->updateProjectOp();
// $projectModel = new Project();
... ... @@ -94,8 +112,8 @@ class UpdateRoute extends Command
// }
// DB::disconnect('custom_mysql');
// }
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
}
// echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
// }
/**
* @remark :更新产品
... ...