From 6053356b6935655557dd2200325fe7a3ed16c3ec Mon Sep 17 00:00:00 2001 From: chengxl Date: Wed, 25 Jun 2025 17:03:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E8=8D=89=E7=A8=BF=E7=AE=B1?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=B0=8F=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 | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/application/api/controller/Aiarticle.php b/application/api/controller/Aiarticle.php index 316876d..4fb26ae 100644 --- a/application/api/controller/Aiarticle.php +++ b/application/api/controller/Aiarticle.php @@ -1160,6 +1160,15 @@ class Aiarticle extends Base $sTemplate = "Review"; } + //查询期刊微信公众号配置 + $aJournalInfo = Db::name('journal')->field('wechat_app_id,wechat_app_secret')->where('issn',$sWechatId)->find(); + if(empty($aJournalInfo['wechat_app_id']) || empty($aJournalInfo['wechat_app_secret'])){ + //获取默认配置 + $aJournalInfo = $this->aWechatConfig; + $sWechatId = $aJournalInfo['issn'] ?? 'default'; + } + + //查询该模版是否推送到微信公众号 $aWhere['wechat_id'] = $sWechatId; $aWhere['template_id'] = $sTemplate; @@ -1169,13 +1178,6 @@ class Aiarticle extends Base return json_encode(['status' => 4, 'msg' => 'Already uploaded to draft box']); } - //查询期刊微信公众号配置 - $aJournalInfo = Db::name('journal')->field('wechat_app_id,wechat_app_secret')->where('issn',$sWechatId)->find(); - if(empty($aJournalInfo['wechat_app_id']) || empty($aJournalInfo['wechat_app_secret'])){ - //获取默认配置 - $aJournalInfo = $this->aWechatConfig; - $sWechatId = $aJournalInfo['issn'] ?? 'default'; - } //数据处理-标题 $sTitle = empty($aAiArticle['title']) ? '' : $aAiArticle['title'];