From c244d9805c62c744229f55c04ff8a1082293f8af Mon Sep 17 00:00:00 2001 From: chengxl Date: Fri, 7 Nov 2025 16:51:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Contribute.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/api/controller/Contribute.php b/application/api/controller/Contribute.php index b5d4f15..2c0a17f 100644 --- a/application/api/controller/Contribute.php +++ b/application/api/controller/Contribute.php @@ -91,11 +91,11 @@ class Contribute extends Base return json_encode(['status' => 6,'msg' => 'The article title is empty']); } //查询标题是否存在 - // $aWhere += ['title' => trim($aData['title']),'state' => ['<>',3]]; - // $aArticle = Db::name('article')->field('article_id')->where($aWhere)->find(); - // if(!empty($aArticle)){ - // return json_encode(['code' => 7, 'msg' => 'Warning: you are re-submitting the article!']); - // } + $aWhere += ['title' => trim($aData['title']),'state' => ['<>',3]]; + $aArticle = Db::name('article')->field('article_id')->where($aWhere)->find(); + if(!empty($aArticle)){ + return json_encode(['code' => 7, 'msg' => 'Warning: you are re-submitting the article!']); + } //数据入库 $aData += $aParam; $result = $this->_addData($aData);