From befef684cbf596de89718769e0c99cb1e63afc7e Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 3 Jun 2025 14:36:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=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 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/application/api/controller/Aiarticle.php b/application/api/controller/Aiarticle.php index 7b0bb9a..b854c33 100644 --- a/application/api/controller/Aiarticle.php +++ b/application/api/controller/Aiarticle.php @@ -66,7 +66,7 @@ class Aiarticle extends Base **核心要求** 1️ 内容涵盖哪些学科及方法请罗列 2 翻译好的内容将以公众号的形式推送给读者,按学术规范翻译并提炼文章概述,整体内容应大于1200字,其中应包函文章背景(不少于400字)内容,其他内容提炼更强调逻辑性、科学术语准确性和表达的严谨性,注意内容不要有严重重复,不需要分点展示,大于1000字 - 3 针对文章结论生成一个简单总结,内容不要重复,大于300字 + 3 针对文章结论生成一个简单总结,内容不要和文章概述重复,字数150以内 4 请将标题翻译成中文【内容需自然流畅、口语化、连贯性、学术性】 {#title_chinese#} 5 请将文章内容翻译成中文【内容需自然流畅、口语化、连贯性、学术性】 @@ -673,7 +673,7 @@ class Aiarticle extends Base * @param template_id 模版ID * @param $iIsSync 是否同步素材到微信 1是2否 */ - public function getTemplateContent($aParam = []){ + public function getTemplateContent($aParam = [],$iIsSync = 2){ //获取参数 $aParam = empty($aParam) ? $this->request->post() : $aParam; @@ -758,7 +758,7 @@ class Aiarticle extends Base //组装作者数据 if(!empty($aAuthor)){ $aAuthor = $this->_dealAuthor($aAuthor); - $aUpload['author_info'] = $aAuthor; + $aQueryParam['author_info'] = $aAuthor; } //获取素材信息 @@ -786,7 +786,7 @@ class Aiarticle extends Base $aDataInfo = array_column($aDataInfo, null,'email'); foreach ($aAuthor as $key => $value) { $aAuthorData = empty($aDataInfo[$value['email']]) ? [] : $aDataInfo[$value['email']]; - if(empty($aUser)){ + if(empty($aAuthorData)){ continue; } $aAuthor[$key]['icon'] = empty($aAuthorData['media_url']) ? $value['icon'] : $aAuthorData['media_url']; @@ -1216,7 +1216,7 @@ class Aiarticle extends Base //获取模版生成内容 $aTemplateParam = ['article_id' => $iArticleId,'template_id' => $sTemplate,'is_sync' => 1,'wechat_id' => $sWechatId]; $aTemplateParam += $aJournalInfo; - $aResult = json_decode($this->getTemplateContent($aTemplateParam),true); + $aResult = json_decode($this->getTemplateContent($aTemplateParam,1),true); $sMsg = empty($aResult['msg']) ? 'The content is empty' : $aResult['msg']; $aData = empty($aResult['data']) ? [] : $aResult['data']; if(empty($aData['template'])){ @@ -1554,7 +1554,7 @@ class Aiarticle extends Base $oMaterial = new Material; $aLog = json_decode($oMaterial->getWechatLog(['article_id' => $iArticleId,'type' => 1,'status' =>1]),true); if(!empty($aLog['data'])){ - return json_encode(['status' => -1,'msg' => 'The material has been uploaded','data' => []]); + return json_encode(['status' => 1,'msg' => 'The material has been uploaded','data' => []]); } //获取AI生成文章内容