|
@@ -180,7 +180,7 @@ class AiBlogLogic extends BaseLogic |
|
@@ -180,7 +180,7 @@ class AiBlogLogic extends BaseLogic |
|
180
|
//推送到ai的数据结构
|
180
|
//推送到ai的数据结构
|
|
181
|
$data = [
|
181
|
$data = [
|
|
182
|
'title'=>$param['new_title'], 'thumb'=>$param['image'], 'foreword'=>$param['description'] ?? '',
|
182
|
'title'=>$param['new_title'], 'thumb'=>$param['image'], 'foreword'=>$param['description'] ?? '',
|
|
183
|
- 'author_id'=>$this->param['author_id'], 'url'=>$param['route'],
|
183
|
+ 'author_id'=>$param['author_id'], 'url'=>$param['route'],
|
|
184
|
];
|
184
|
];
|
|
185
|
if(!isset($param['description']) || empty($param['description'])){
|
185
|
if(!isset($param['description']) || empty($param['description'])){
|
|
186
|
$param['description'] = truncate_text($param['text']);
|
186
|
$param['description'] = truncate_text($param['text']);
|
|
@@ -217,10 +217,12 @@ class AiBlogLogic extends BaseLogic |
|
@@ -217,10 +217,12 @@ class AiBlogLogic extends BaseLogic |
|
217
|
}
|
217
|
}
|
|
218
|
$aiBlogService = new AiBlogService($this->user['project_id']);
|
218
|
$aiBlogService = new AiBlogService($this->user['project_id']);
|
|
219
|
$result = $aiBlogService->createCustomBlog($data);
|
219
|
$result = $aiBlogService->createCustomBlog($data);
|
|
|
|
220
|
+ $this->model->edit(['task_id'=>$result['data']['task_id'] ?? '','status'=>$this->model::STATUS_FINISH],['id'=>$id]);
|
|
220
|
if(isset($result['status']) && $result['status'] == 200){
|
221
|
if(isset($result['status']) && $result['status'] == 200){
|
|
221
|
- $this->model->edit(['task_id'=>$result['data']['task_id'],'status'=>$this->model::STATUS_FINISH],['id'=>$id]);
|
|
|
|
222
|
//todo::更新列表页
|
222
|
//todo::更新列表页
|
|
223
|
shell_exec("php artisan save_ai_blog_list {$this->user['project_id']} > /dev/null 2>&1 &");
|
223
|
shell_exec("php artisan save_ai_blog_list {$this->user['project_id']} > /dev/null 2>&1 &");
|
|
|
|
224
|
+ }else{
|
|
|
|
225
|
+ $this->fail('发布失败,请编辑后重新发布');
|
|
224
|
}
|
226
|
}
|
|
225
|
return $this->success();
|
227
|
return $this->success();
|
|
226
|
}
|
228
|
}
|