From c288e446e2044806a3a72e9c373f6635cd3ef556 Mon Sep 17 00:00:00 2001 From: chengxl Date: Thu, 29 May 2025 13:47:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=85=AC=E4=BC=97=E5=8F=B7?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Cronwechat.php | 24 ++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/application/api/controller/Cronwechat.php b/application/api/controller/Cronwechat.php index e0ee6be..bedd837 100644 --- a/application/api/controller/Cronwechat.php +++ b/application/api/controller/Cronwechat.php @@ -75,9 +75,11 @@ class Cronwechat extends Controller } //插入操作日志 if(!empty($aLog)){ - $result = Db::name('wechat_crontab_log')->insertAll($aLog); - if($result === false){ - $this->showMessage('插入日志记录失败:'.json_encode($aLog)."\n",2); + $result = json_decode($oAiarticle->addWechatLog($aLog)); + $iStatus = empty($result['status']) ? 0 : $result['status']; + $sMsg = empty($result['msg']) ? '插入日志记录失败' : $result['msg']; + if($iStatus != 1){ + $this->showMessage($sMsg,2); } } $this->showMessage('AI生成的文章推送草稿箱完成:'.$sDate."\n",1); @@ -138,9 +140,11 @@ class Cronwechat extends Controller } //插入操作日志 if(!empty($aLog)){ - $result = Db::name('wechat_crontab_log')->insertAll($aLog); - if($result === false){ - $this->showMessage('插入日志记录失败:'.json_encode($aLog)."\n",2); + $result = json_decode($oAiarticle->addWechatLog($aLog)); + $iStatus = empty($result['status']) ? 0 : $result['status']; + $sMsg = empty($result['msg']) ? '插入日志记录失败' : $result['msg']; + if($iStatus != 1){ + $this->showMessage($sMsg,2); } } $this->showMessage('AI生成的文章发布草稿箱完成:'.$sDate."\n",1); @@ -197,9 +201,11 @@ class Cronwechat extends Controller } //插入操作日志 if(!empty($aLog)){ - $result = Db::name('wechat_crontab_log')->insertAll($aLog); - if($result === false){ - $this->showMessage('插入日志记录失败:'.json_encode($aLog)."\n",2); + $result = json_decode($oAiarticle->addWechatLog($aLog)); + $iStatus = empty($result['status']) ? 0 : $result['status']; + $sMsg = empty($result['msg']) ? '插入日志记录失败' : $result['msg']; + if($iStatus != 1){ + $this->showMessage($sMsg,2); } } $this->showMessage('AI生成的文章发布状态查询完成:'.$sDate."\n",1);