|
@@ -160,6 +160,8 @@ class ProjectLogic extends BaseLogic |
|
@@ -160,6 +160,8 @@ class ProjectLogic extends BaseLogic |
|
160
|
$this->setServers($this->param['serve_id'],$this->param['id']);
|
160
|
$this->setServers($this->param['serve_id'],$this->param['id']);
|
|
161
|
//保存项目信息
|
161
|
//保存项目信息
|
|
162
|
$this->saveProject($this->param);
|
162
|
$this->saveProject($this->param);
|
|
|
|
163
|
+ //ai_blog
|
|
|
|
164
|
+ $this->setAiBlog($this->param['id'],$this->param['main_lang_id'],$this->param['is_ai_blog'],$this->param['title']);
|
|
163
|
//保存建站部署信息
|
165
|
//保存建站部署信息
|
|
164
|
$this->saveProjectDeployBuild($this->param['deploy_build']);
|
166
|
$this->saveProjectDeployBuild($this->param['deploy_build']);
|
|
165
|
//保存付费信息
|
167
|
//保存付费信息
|
|
@@ -192,18 +194,15 @@ class ProjectLogic extends BaseLogic |
|
@@ -192,18 +194,15 @@ class ProjectLogic extends BaseLogic |
|
192
|
* @method :post
|
194
|
* @method :post
|
|
193
|
* @time :2025/2/13 16:02
|
195
|
* @time :2025/2/13 16:02
|
|
194
|
*/
|
196
|
*/
|
|
195
|
- public function setAiBlog($project_id){
|
|
|
|
196
|
- if(empty($this->param['main_lang_id'])){
|
|
|
|
197
|
- return true;
|
|
|
|
198
|
- }
|
|
|
|
199
|
- if($this->param['is_ai_blog'] == 0){
|
197
|
+ public function setAiBlog($project_id,$main_lang_id,$is_ai_blog,$title){
|
|
|
|
198
|
+ if(empty($main_lang_id) || empty($is_ai_blog)){
|
|
200
|
return true;
|
199
|
return true;
|
|
201
|
}
|
200
|
}
|
|
202
|
$projectModel = new Project();
|
201
|
$projectModel = new Project();
|
|
203
|
$projectInfo = $projectModel->read(['id'=>$project_id],['is_ai_blog','main_lang_id']);
|
202
|
$projectInfo = $projectModel->read(['id'=>$project_id],['is_ai_blog','main_lang_id']);
|
|
204
|
//获取项目主语种
|
203
|
//获取项目主语种
|
|
205
|
$languageModel = new WebLanguage();
|
204
|
$languageModel = new WebLanguage();
|
|
206
|
- $languageInfo = $languageModel->read(['id'=>$this->param['main_lang_id']],['short']);
|
205
|
+ $languageInfo = $languageModel->read(['id'=>$main_lang_id],['short']);
|
|
207
|
if($languageInfo == false){
|
206
|
if($languageInfo == false){
|
|
208
|
return true;
|
207
|
return true;
|
|
209
|
}
|
208
|
}
|
|
@@ -211,7 +210,7 @@ class ProjectLogic extends BaseLogic |
|
@@ -211,7 +210,7 @@ class ProjectLogic extends BaseLogic |
|
211
|
$aiSettingInfo = $aiSettingModel->read(['project_id'=>$project_id]);
|
210
|
$aiSettingInfo = $aiSettingModel->read(['project_id'=>$project_id]);
|
|
212
|
if($aiSettingInfo === false){
|
211
|
if($aiSettingInfo === false){
|
|
213
|
$aiBlogService = new AiBlogService();
|
212
|
$aiBlogService = new AiBlogService();
|
|
214
|
- $result = $aiBlogService->createProject($this->param['title'],$languageInfo['short'],$projectInfo['company']);
|
213
|
+ $result = $aiBlogService->createProject($title,$languageInfo['short'],$projectInfo['company']);
|
|
215
|
if($result['status'] == 200){
|
214
|
if($result['status'] == 200){
|
|
216
|
//查看当前项目是否已有记录
|
215
|
//查看当前项目是否已有记录
|
|
217
|
$resData = [
|
216
|
$resData = [
|
|
@@ -223,11 +222,11 @@ class ProjectLogic extends BaseLogic |
|
@@ -223,11 +222,11 @@ class ProjectLogic extends BaseLogic |
|
223
|
}
|
222
|
}
|
|
224
|
}else{
|
223
|
}else{
|
|
225
|
//有信息更新
|
224
|
//有信息更新
|
|
226
|
- if(($projectInfo['title'] != $this->param['title']) || ($languageInfo['short'] != $this->param['short'])){
|
225
|
+ if(($projectInfo['title'] != $title) || ($projectInfo['main_lang_id'] != $main_lang_id)){
|
|
227
|
$aiBlogService = new AiBlogService();
|
226
|
$aiBlogService = new AiBlogService();
|
|
228
|
$aiBlogService->mch_id = $aiSettingInfo['mch_id'];
|
227
|
$aiBlogService->mch_id = $aiSettingInfo['mch_id'];
|
|
229
|
$aiBlogService->key = $aiSettingInfo['key'];
|
228
|
$aiBlogService->key = $aiSettingInfo['key'];
|
|
230
|
- $result = $aiBlogService->updatedProject($this->param['title'],$languageInfo['short']);
|
229
|
+ $result = $aiBlogService->updatedProject($title,$languageInfo['short']);
|
|
231
|
if($result['status'] == 200){
|
230
|
if($result['status'] == 200){
|
|
232
|
$resData = [
|
231
|
$resData = [
|
|
233
|
'mch_id'=>$result['data']['mch_id'],
|
232
|
'mch_id'=>$result['data']['mch_id'],
|