From 3356ef59cbdd4c0127568e6e8aaad0ce818c9332 Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 24 Jun 2025 16:02:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8C=96=E5=AE=A1=E7=A8=BF?= =?UTF-8?q?=E9=82=80=E8=AF=B7=E5=AE=A1=E7=A8=BF=E4=BA=BA=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E6=A8=A1=E7=89=88=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/Reviewer.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/common/Reviewer.php b/application/common/Reviewer.php index f5b77a0..8b0233e 100644 --- a/application/common/Reviewer.php +++ b/application/common/Reviewer.php @@ -176,6 +176,7 @@ class Reviewer //查询文章所属领域 $aWhere['state'] = 0; $aMajor = json_decode($this->getArticleMajor($aWhere),true); + $aMajorId = empty($aMajor['data']) ? [] : $aMajor['data']; if(empty($aMajorId)){ return json_encode(array('status' => 1,'msg' => 'No field found for the article','data' => [])); @@ -194,6 +195,7 @@ class Reviewer // 先查询符合专业条件的审稿人ID $aWhere = ['state' => 0, 'major_id' => ['in', $aMajorId]]; $sMajorQuery = Db::name('major_to_user')->field('user_id')->where($aWhere)->buildSql(); + // 查询符合公司条件的审稿人ID,确保去重 $aWhere = ['state' => 0, 'company' => ['<>', $sCompany]]; if(!empty($aBlack) && !empty($aParam['not_choose_id'])){ @@ -312,7 +314,8 @@ class Reviewer return json_encode(['status' => 2,'msg' => 'Please select the article to query']); } //查询数据库 - $aMajor = Db::name('major_to_article')->where('article_id',$iArticleId)->column('major_id'); + $aWhere = ['article_id' => $iArticleId,'state' => 0]; + $aMajor = Db::name('major_to_article')->where($aWhere)->column('major_id'); return json_encode(['status' => 1,'msg' => 'success','data' => $aMajor]); }