公众号接口调整

This commit is contained in:
chengxl
2025-05-14 18:05:19 +08:00
parent 3849554020
commit 4391b2c86d

View File

@@ -246,10 +246,11 @@ class Aiarticle extends Base
if($iId === false){ if($iId === false){
return json_encode(['status' => 4,'msg' => 'Data insertion failed']); return json_encode(['status' => 4,'msg' => 'Data insertion failed']);
} }
$aAiArticle = array_merge(['ai_article_id' => $iId,'article_id' => $iArticleId,'is_generate' => 2],$aInsert);
} }
//判断是否生成 //判断是否生成
if($aAiArticle['is_generate'] == 1){ if(!empty($aAiArticle['is_generate']) && $aAiArticle['is_generate'] == 1){
return json_encode(['status' => 5,'msg' => 'The data has been generated, please proceed with the next steps']); return json_encode(['status' => 5,'msg' => 'The data has been generated, please proceed with the next steps']);
} }
@@ -694,6 +695,7 @@ class Aiarticle extends Base
Db::startTrans(); Db::startTrans();
//执行入库 //执行入库
$aUpdateParam['update_time'] = time(); $aUpdateParam['update_time'] = time();
$aUpdateParam['author'] = empty($aUpdateParam['author']) ? 'TMR编辑部' : $aUpdateParam['author'];
$aUpdateParam['is_generate'] = 1; $aUpdateParam['is_generate'] = 1;
$result = Db::name('ai_article')->where('ai_article_id',$iAiArticleId)->limit(1)->update($aUpdateParam); $result = Db::name('ai_article')->where('ai_article_id',$iAiArticleId)->limit(1)->update($aUpdateParam);
if($result === false){ if($result === false){