From 972331c24e3fdc69b865a37fe8aa0d7c4614a40f Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 6 Jan 2026 10:58:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A8=BF=E4=BB=B6=E9=AA=8C=E8=AF=81=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Article.php | 39 +++++++++++++++----------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index 82575497..fb29a794 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -3428,6 +3428,17 @@ class Article extends Base return jsonError("Submission failed"); } $article_id = $data['article_id']; + + //查询标题是否存在 + $oArticle = new \app\common\Article; + $aCheckTitle = $oArticle->checkTitle(['title' => $data['title'],'article_id' => $article_id,'user_id' => $data['user_id']]); + $iStatus = empty($aCheckTitle['status']) ? -1 : $aCheckTitle['status']; + $sMsg = empty($aCheckTitle['msg']) ? '': $aCheckTitle['msg']; + $iDraftId = empty($aCheckTitle['draft_id']) ? 0 : $aCheckTitle['draft_id']; + if($iStatus != 1){ + return json(['code' => $iStatus, 'msg' => $sMsg,'draft_id' => $iDraftId]); + } + //添加文章基础信息 if ($data['article_id'] == 0) { $checkArticle = $this->article_obj->where("title", trim($data['title']))->select(); @@ -4616,20 +4627,10 @@ class Article extends Base $where['editor_id'] = $uidres[0]; } $where['state'] = 0; - $list = $this->journal_obj->where($where)->select(); - - // //获取期刊封面 chengxiaoling 20251027 start - // if(!empty($list)){ - // $aParam = ['issn' => array_column($list, 'issn')]; - // $sUrl = 'http://journalapi.tmrjournals.com/public/index.php/'; - // $sUrl = $sUrl."api/Supplementary/getJournal"; - // $aResult = object_to_array(json_decode(myPost1($sUrl,$aParam),true)); - // $aResult = empty($aResult['data']) ? [] : array_column($aResult['data'], 'icon','issn'); - // foreach ($list as $key => $value) { - // $list[$key]['journal_icon'] = empty($aResult[$value['issn']]) ? '' : $aResult[$value['issn']]; - // } - // } - // //获取期刊封面 chengxiaoling 20251027 end + $list = $this->journal_obj + ->field("journal_id,title,issn,editorinchief,zname,abbr,alias,editor_id,staff_id,level, + jabbr,jour_num,jour_price,email,cycle,scope,fee,kfen,website,journal_icon,apc_url,state") + ->where($where)->select(); return json($list); } @@ -4639,7 +4640,10 @@ class Article extends Base public function getJournalOutLx() { $editorid = $this->request->post('editor_id'); - $list = $this->journal_obj->where('editor_id', $editorid)->where('journal_id', 'not in', '2,3,15')->select(); + $list = $this->journal_obj + ->field("journal_id,title,issn,editorinchief,zname,abbr,alias,editor_id,staff_id,level, + jabbr,jour_num,jour_price,email,cycle,scope,fee,kfen,website,journal_icon,apc_url,state") + ->where('editor_id', $editorid)->where('journal_id', 'not in', '2,3,15')->select(); return json($list); } @@ -4748,7 +4752,10 @@ class Article extends Base if (!$res) { return jsonError('no this user!'); } - $journals = $this->journal_obj->where('editor_id', $res['user_id'])->where('journal_id', 'in', '2,3,15')->select(); + $journals = $this->journal_obj + ->field("journal_id,title,issn,editorinchief,zname,abbr,alias,editor_id,staff_id,level, + jabbr,jour_num,jour_price,email,cycle,scope,fee,kfen,website,journal_icon,apc_url,state") + ->where('editor_id', $res['user_id'])->where('journal_id', 'in', '2,3,15')->select(); $re['journals'] = $journals; return jsonSuccess($re); }