From f2efa65798fad8d134ce3d28951cb8bf96457b08 Mon Sep 17 00:00:00 2001 From: chengxl Date: Sat, 17 May 2025 18:49:43 +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 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/application/api/controller/Aiarticle.php b/application/api/controller/Aiarticle.php index c273f46..3585b9c 100644 --- a/application/api/controller/Aiarticle.php +++ b/application/api/controller/Aiarticle.php @@ -651,17 +651,22 @@ class Aiarticle extends Base //获取文章内容 $aResult = json_decode($this->getArticle($iArticleId),true); - if($aResult['status'] != 1){ - return json_encode($aResult); - } //获取数据 $aArticleContent = empty($aResult['data']) ? [] : $aResult['data']; + if(empty($aArticleContent)){ + return json_encode($aResult); + } //文章数据 $aArticle = empty($aArticleContent['article']) ? [] : $aArticleContent['article']; - + if(empty($aArticle)){ + return json_encode(['status' => 4,'msg' => 'Article data is empty']); + } //期刊数据 $aJournal = empty($aArticleContent['journal']) ? [] : $aArticleContent['journal']; + if(empty($aJournal)){ + return json_encode(['status' => 4,'msg' => 'Journal data is empty']); + } //子期刊数据 $aJournalStage = empty($aArticleContent['journal_stage']) ? [] : $aArticleContent['journal_stage'];