|
@@ -120,18 +120,18 @@ class AiBlogTask extends Command |
|
@@ -120,18 +120,18 @@ class AiBlogTask extends Command |
|
120
|
DB::disconnect('custom_mysql');
|
120
|
DB::disconnect('custom_mysql');
|
|
121
|
return false;
|
121
|
return false;
|
|
122
|
}
|
122
|
}
|
|
123
|
- //需要更新的路由
|
|
|
|
124
|
- if (!in_array($result['data']['author_id'], $this->updateProject[$item['project_id']] ?? [])) {
|
|
|
|
125
|
- $this->updateProject[$item['project_id']][] = $result['data']['author_id'];
|
|
|
|
126
|
- }
|
|
|
|
127
|
- if (!in_array($aiBlogInfo['route'], $this->routes[$item['project_id']] ?? [])) {
|
|
|
|
128
|
- $this->routes[$item['project_id']][] = $aiBlogInfo['route'];
|
|
|
|
129
|
- }
|
|
|
|
130
|
//拿到返回的路由查看是否重复
|
123
|
//拿到返回的路由查看是否重复
|
|
131
|
$route = RouteMap::setRoute($result['data']['url'], RouteMap::SOURCE_AI_BLOG, $aiBlogInfo['id'], $item['project_id']);
|
124
|
$route = RouteMap::setRoute($result['data']['url'], RouteMap::SOURCE_AI_BLOG, $aiBlogInfo['id'], $item['project_id']);
|
|
132
|
if($route != $result['data']['url']){
|
125
|
if($route != $result['data']['url']){
|
|
133
|
$aiBlogService->updateDetail(['route'=>$route,'task_id'=>$item['task_id']]);
|
126
|
$aiBlogService->updateDetail(['route'=>$route,'task_id'=>$item['task_id']]);
|
|
134
|
}
|
127
|
}
|
|
|
|
128
|
+ //需要更新的路由
|
|
|
|
129
|
+ if (!in_array($result['data']['author_id'], $this->updateProject[$item['project_id']] ?? [])) {
|
|
|
|
130
|
+ $this->updateProject[$item['project_id']][] = $result['data']['author_id'];
|
|
|
|
131
|
+ }
|
|
|
|
132
|
+ if (!in_array($route, $this->routes[$item['project_id']] ?? [])) {
|
|
|
|
133
|
+ $this->routes[$item['project_id']][] = $route;
|
|
|
|
134
|
+ }
|
|
135
|
$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']]);
|
135
|
$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']]);
|
|
136
|
DB::disconnect('custom_mysql');
|
136
|
DB::disconnect('custom_mysql');
|
|
137
|
$aiBlogTaskModel->edit(['status'=>$aiBlogModel::STATUS_FINISH],['id'=>$item['id']]);
|
137
|
$aiBlogTaskModel->edit(['status'=>$aiBlogModel::STATUS_FINISH],['id'=>$item['id']]);
|