|
...
|
...
|
@@ -55,9 +55,7 @@ class AiBlogLogic extends BaseLogic |
|
|
|
$aiBlogService = new AiBlogService();
|
|
|
|
$aiBlogService->mch_id = $aiSettingInfo['mch_id'];
|
|
|
|
$aiBlogService->key = $aiSettingInfo['key'];
|
|
|
|
if(!empty($this->param['route'])){
|
|
|
|
$aiBlogService->route = generateRoute(Translate::tran($this->param['route'], 'en'));
|
|
|
|
}
|
|
|
|
$result = $aiBlogService->createTask($this->param['keyword'],$this->param['type']);
|
|
|
|
if($result['status'] == 200){
|
|
|
|
$aiBlogTaskModel = new AiBlogTask();
|
|
...
|
...
|
@@ -65,11 +63,9 @@ class AiBlogLogic extends BaseLogic |
|
|
|
$aiBlogModel = new AiBlog();
|
|
|
|
$aiBlogId = $aiBlogModel->addReturnId(['keyword'=>$this->param['keyword'], 'status'=>$result['data']['status'], 'task_id'=>$result['data']['task_id'],'project_id'=>$this->user['project_id'],
|
|
|
|
]);
|
|
|
|
if(!empty($aiBlogService->route)){
|
|
|
|
$route = RouteMap::setRoute($aiBlogService->route, RouteMap::SOURCE_AI_BLOG, $aiBlogId, $this->user['project_id']);
|
|
|
|
$aiBlogModel->edit(['route'=>$route],['id'=>$aiBlogId]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|