From ccb28ce850cd18752ba8f1948940b642410b7cc4 Mon Sep 17 00:00:00 2001 From: chengxl Date: Wed, 23 Apr 2025 11:46:32 +0800 Subject: [PATCH] =?UTF-8?q?ai=E6=8E=A8=E8=8D=90=E5=AE=A1=E7=A8=BF=E4=BA=BA?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Recommend.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/application/api/controller/Recommend.php b/application/api/controller/Recommend.php index cca3b4c..982e7d5 100644 --- a/application/api/controller/Recommend.php +++ b/application/api/controller/Recommend.php @@ -65,6 +65,16 @@ class Recommend extends Base //条件拼接 $aWhere = ['state' => 0,'is_reviewer' => 1]; + + //查询文章作者详情 作者和审稿人的机构不一致 + $aUserInfo = Db::name('user')->field('email')->where('user_id',$aArticle['user_id'])->find(); + $sEmail = empty($aUserInfo['email']) ? '' : $aUserInfo['email']; + if(!empty($sEmail)){ + $aAuthor = Db::name('article_author')->field('company')->where(['article_id'=>$aArticle['article_id'],'email' => $sEmail,'state' => 0])->find(); + if(empty($aAuthor)){ + exit(json_encode(array('status' => 1,'msg' => 'No detailed information about the author of the article was found','data' => []))); + } + } //查询审稿人的补充信息表拼接参数 $aReviewerWhere = []; if(!empty($aParam['field'])){//根据领域搜索 @@ -84,14 +94,9 @@ class Recommend extends Base //查用户信息 $aWhere['user_id'] = ['in',$aMajorUser]; - //查询文章作者详情 作者和审稿人的机构不一致 - $aUserInfo = Db::name('user')->field('email')->where('user_id',$aArticle['user_id'])->find(); - $sEmail = empty($aUserInfo['email']) ? '' : $aUserInfo['email']; + if(!empty($sEmail)){ - $aAuthor = Db::name('article_author')->field('company')->where(['article_id'=>$aArticle['article_id'],'email' => $sEmail,'state' => 0])->find(); - if(empty($aAuthor)){ - exit(json_encode(array('status' => 1,'msg' => 'No detailed information about the author of the article was found','data' => []))); - } + //查询该用户关联的文章ID $aArticleId = Db::name('article_author')->where('email', $sEmail)->column('article_id'); if(!empty($aArticleId)){