|
@@ -55,9 +55,7 @@ class AiBlogLogic extends BaseLogic |
|
@@ -55,9 +55,7 @@ class AiBlogLogic extends BaseLogic |
|
55
|
$aiBlogService = new AiBlogService();
|
55
|
$aiBlogService = new AiBlogService();
|
|
56
|
$aiBlogService->mch_id = $aiSettingInfo['mch_id'];
|
56
|
$aiBlogService->mch_id = $aiSettingInfo['mch_id'];
|
|
57
|
$aiBlogService->key = $aiSettingInfo['key'];
|
57
|
$aiBlogService->key = $aiSettingInfo['key'];
|
|
58
|
- if(!empty($this->param['route'])){
|
|
|
|
59
|
- $aiBlogService->route = generateRoute(Translate::tran($this->param['route'], 'en'));
|
|
|
|
60
|
- }
|
58
|
+ $aiBlogService->route = generateRoute(Translate::tran($this->param['route'], 'en'));
|
|
61
|
$result = $aiBlogService->createTask($this->param['keyword'],$this->param['type']);
|
59
|
$result = $aiBlogService->createTask($this->param['keyword'],$this->param['type']);
|
|
62
|
if($result['status'] == 200){
|
60
|
if($result['status'] == 200){
|
|
63
|
$aiBlogTaskModel = new AiBlogTask();
|
61
|
$aiBlogTaskModel = new AiBlogTask();
|
|
@@ -65,10 +63,8 @@ class AiBlogLogic extends BaseLogic |
|
@@ -65,10 +63,8 @@ class AiBlogLogic extends BaseLogic |
|
65
|
$aiBlogModel = new AiBlog();
|
63
|
$aiBlogModel = new AiBlog();
|
|
66
|
$aiBlogId = $aiBlogModel->addReturnId(['keyword'=>$this->param['keyword'], 'status'=>$result['data']['status'], 'task_id'=>$result['data']['task_id'],'project_id'=>$this->user['project_id'],
|
64
|
$aiBlogId = $aiBlogModel->addReturnId(['keyword'=>$this->param['keyword'], 'status'=>$result['data']['status'], 'task_id'=>$result['data']['task_id'],'project_id'=>$this->user['project_id'],
|
|
67
|
]);
|
65
|
]);
|
|
68
|
- if(!empty($aiBlogService->route)){
|
|
|
|
69
|
- $route = RouteMap::setRoute($aiBlogService->route, RouteMap::SOURCE_AI_BLOG, $aiBlogId, $this->user['project_id']);
|
|
|
|
70
|
- $aiBlogModel->edit(['route'=>$route],['id'=>$aiBlogId]);
|
|
|
|
71
|
- }
|
66
|
+ $route = RouteMap::setRoute($aiBlogService->route, RouteMap::SOURCE_AI_BLOG, $aiBlogId, $this->user['project_id']);
|
|
|
|
67
|
+ $aiBlogModel->edit(['route'=>$route],['id'=>$aiBlogId]);
|
|
72
|
}
|
68
|
}
|
|
73
|
return $this->success();
|
69
|
return $this->success();
|
|
74
|
}
|
70
|
}
|