From df3a5f0b15082a68c67363f6eb9235ffff2f5fee Mon Sep 17 00:00:00 2001 From: chengxl Date: Thu, 28 Aug 2025 15:18:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=88=E5=AE=A1=E7=9B=B8=E5=85=B3=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Article.php | 43 +++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index 67af1fb..c06352b 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -418,7 +418,7 @@ class Article extends Base foreach ($state_num as $item) { $num_arr[$item['state']] = $item['num']; } - for ($i = 0; $i < 7; $i++) { + for ($i = 0; $i <= 7; $i++) { $num_frag[$i] = isset($num_arr[$i]) ? $num_arr[$i] : 0; } @@ -1221,6 +1221,47 @@ class Article extends Base return jsonError("Status cannot be changed"); } + //终审判断[3个审稿人审稿意见为:同意/1个审稿人审稿意见为:不同意] chengxiaoling 20250825 start + if(isset($data['state']) && $data['state'] == 7){ + if($article_info['state'] != 1){ + return jsonError("The article status is not with editor"); + } + $iId = empty($data['articleId']) ? 0 : $data['articleId'];//文章ID + if(empty($iId)){ + return jsonError("Please select an article"); + } + //判断是否有审稿记录 + $aReviewerParam = ['article_id' => $iId,'state' => ['between',[1,3]]]; + $aReviewLists = Db::name('article_reviewer')->where($aReviewerParam)->column('state'); + if(empty($aReviewLists)){ + return jsonError("Reviewer did not conduct a review"); + } + //判断审稿记录是否有拒稿 + if(!in_array(2, $aReviewLists)){//拒稿 + if(count($aReviewLists) < 3){ + return jsonError("The number of reviewers is less than 3"); + } + } + + //更新文章状态 + $aWhere = ['article_id' => $iId,'state' => 1]; + $sUpateResult = $this->article_obj->where($aWhere)->limit(1)->update(['state' => 7]); + if($sUpateResult === false){ + return jsonError("Status update failed"); + } + //添加文章状态信息(如果状态未更新可做通话用,并结束操作) + $insert_data['article_id'] = $iId; + $insert_data['content'] = 'The article enters the final review stage'; + $insert_data['state_from'] = $article_info['state']; + $insert_data['state_to'] = 8; + $insert_data['ctime'] = time(); + if(!$this->article_msg_obj->insert($insert_data)){ + return jsonError("article_msg insertion failed"); + } + return json(['code' => 0]); + } + //终审判断[3个审稿人审稿意见为:同意/1个审稿人审稿意见为:不同意] chengxiaoling 20250825 end + //判断文章的h指数是否添加 $authors = $this->article_author_obj->where('article_id', $data['articleId'])->where('is_report', 1)->select(); // $h_check = false;