|
...
|
...
|
@@ -120,18 +120,18 @@ class AiBlogTask extends Command |
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
//需要更新的路由
|
|
|
|
if (!in_array($result['data']['author_id'], $this->updateProject[$item['project_id']] ?? [])) {
|
|
|
|
$this->updateProject[$item['project_id']][] = $result['data']['author_id'];
|
|
|
|
}
|
|
|
|
if (!in_array($aiBlogInfo['route'], $this->routes[$item['project_id']] ?? [])) {
|
|
|
|
$this->routes[$item['project_id']][] = $aiBlogInfo['route'];
|
|
|
|
}
|
|
|
|
//拿到返回的路由查看是否重复
|
|
|
|
$route = RouteMap::setRoute($result['data']['url'], RouteMap::SOURCE_AI_BLOG, $aiBlogInfo['id'], $item['project_id']);
|
|
|
|
if($route != $result['data']['url']){
|
|
|
|
$aiBlogService->updateDetail(['route'=>$route,'task_id'=>$item['task_id']]);
|
|
|
|
}
|
|
|
|
//需要更新的路由
|
|
|
|
if (!in_array($result['data']['author_id'], $this->updateProject[$item['project_id']] ?? [])) {
|
|
|
|
$this->updateProject[$item['project_id']][] = $result['data']['author_id'];
|
|
|
|
}
|
|
|
|
if (!in_array($route, $this->routes[$item['project_id']] ?? [])) {
|
|
|
|
$this->routes[$item['project_id']][] = $route;
|
|
|
|
}
|
|
|
|
$aiBlogModel->edit(['new_title'=>$result['data']['title'], 'image'=>$result['data']['thumb'], 'text'=>$result['data']['section'], 'author_id'=>$result['data']['author_id'],'seo_title'=>$result['data']['title'],'seo_keyword'=>$result['data']['keyword'],'seo_description'=>$result['data']['description'], 'route'=>$route ,'status'=>$aiBlogModel::STATUS_FINISH], ['task_id'=>$item['task_id']]);
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
$aiBlogTaskModel->edit(['status'=>$aiBlogModel::STATUS_FINISH],['id'=>$item['id']]);
|
...
|
...
|
|