|
...
|
...
|
@@ -185,15 +185,19 @@ class AiBlogLogic extends BaseLogic |
|
|
|
if(isset($param['id']) && !empty($param['id'])){
|
|
|
|
$data['task_id'] = $param['task_id'];
|
|
|
|
$this->model->edit($param,['id'=>$param['id']]);
|
|
|
|
$id = $param['id'];
|
|
|
|
}else{
|
|
|
|
$param['uuid'] = md5(date('YmdHis').rand(100,999).$this->user['project_id']);
|
|
|
|
$this->model->addReturnId($param);
|
|
|
|
$id = $this->model->addReturnId($param);
|
|
|
|
}
|
|
|
|
$aiBlogService = new AiBlogService($this->user['project_id']);
|
|
|
|
$aiBlogService->createCustomBlog($data);
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('保存失败,请联系管理员');
|
|
|
|
}
|
|
|
|
$aiBlogService = new AiBlogService($this->user['project_id']);
|
|
|
|
$result = $aiBlogService->createCustomBlog($data);
|
|
|
|
if($result['status'] == 200){
|
|
|
|
$this->model->edit(['task_id'=>$result['data']['task_id']],['id'=>$param['id']]);
|
|
|
|
}
|
|
|
|
//todo::更新列表页
|
|
|
|
// shell_exec("php artisan save_ai_blog_list {$this->user['project_id']} > /dev/null 2>&1 &");
|
|
|
|
return $this->success();
|
...
|
...
|
|