From 4391b2c86d5e0fd170d5628042ac62a576353751 Mon Sep 17 00:00:00 2001 From: chengxl Date: Wed, 14 May 2025 18:05:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=B7=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Aiarticle.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/api/controller/Aiarticle.php b/application/api/controller/Aiarticle.php index a1bd685..1415711 100644 --- a/application/api/controller/Aiarticle.php +++ b/application/api/controller/Aiarticle.php @@ -246,10 +246,11 @@ class Aiarticle extends Base if($iId === false){ 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']); } @@ -694,6 +695,7 @@ class Aiarticle extends Base Db::startTrans(); //执行入库 $aUpdateParam['update_time'] = time(); + $aUpdateParam['author'] = empty($aUpdateParam['author']) ? 'TMR编辑部' : $aUpdateParam['author']; $aUpdateParam['is_generate'] = 1; $result = Db::name('ai_article')->where('ai_article_id',$iAiArticleId)->limit(1)->update($aUpdateParam); if($result === false){