diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index b14a9c7..779061c 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -885,27 +885,27 @@ class Article extends Base $c['email'] = $v['email']; $cl = $this->article_author_obj->where("email", $v['email'])->where('state', 0)->select(); foreach ($cl as $value) { - if ($value['firstname'] != "") { - $c['firstname'] = $value['firstname']; - } - if ($value['lastname'] != "") { - $c['lastname'] = $value['lastname']; - } - if ($value['company'] != "") { - $c['company'] = $value['company']; - } - if ($value['department'] != "") { - $c['department'] = $value['department']; - } - if ($value['author_title'] != "") { - $c['author_title'] = $value['author_title']; - } - if ($value['country'] != "") { - $c['country'] = $value['country']; - } - if ($value['address'] != "") { - $c['address'] = $value['address']; - } + // if ($value['firstname'] != "") { + $c['firstname'] = empty($value['firstname']) ? '' : $value['firstname']; + // } + // if ($value['lastname'] != "") { + $c['lastname'] = empty($value['lastname']) ? '' : $value['lastname']; + // } + // if ($value['company'] != "") { + $c['company'] = empty($value['company']) ? '' : $value['company']; + // } + // if ($value['department'] != "") { + $c['department'] = empty($value['department']) ? '' : $value['department']; + // } + // if ($value['author_title'] != "") { + $c['author_title'] = empty($value['author_title']) ? '' : $value['author_title']; + // } + // if ($value['country'] != "") { + $c['country'] = empty($value['country']) ? '' : $value['country']; + // } + // if ($value['address'] != "") { + $c['address'] = empty($value['address']) ? '' : $value['address']; + // } } $authors[] = $c; } @@ -5466,10 +5466,58 @@ class Article extends Base if($iFourStatus == 1){//查询是否推荐审稿人 $aWhere = ['urr_state' => 0,'article_id' => $iArticleId]; $aUserRecommend = Db::name('user_reviewer_recommend')->where($aWhere)->column('reviewer_id'); - if(empty($aMajor)){ + if(empty($aUserRecommend)){ $sFourMsg = 'Step 4: Please recommend reviewers'; $iFourStatus = 2; } + if(!empty($aUserRecommend)){ + //获取基本信息 + $aWhere = ['user_id' => ['in',$aUserRecommend],'state' => 0]; + $aUser = Db::name('user')->field('user_id,account,email,realname')->where($aWhere)->select(); + if(empty($aUser)){ + $sFourMsg = 'Step 4: Recommended reviewer does not exist'; + $iFourStatus = 2; + } + if(!empty($aUser)){ + $aWhere = ['reviewer_id' => ['in',$aUserRecommend],'state' => 0]; + $aReviewer = Db::name('user_reviewer_info')->field('reviewer_id,country,major,company,department')->where($aWhere)->select(); + $aReviewer = array_column($aReviewer, null,'reviewer_id'); + if(empty($aReviewer)){ + $sFourMsg = 'Step 4: Recommended reviewer\'s detailed information does not exist'; + $iFourStatus = 2; + } + if(!empty($aReviewer)){ + foreach ($aUser as $key => $value) { + if(empty($value['email']) || empty($value['realname'])){ + $sFourMsg = 'The Reviewer\'s required information is incomplete'; + $iFourStatus = 2; + break; + } + $value['major'] = empty($aReviewer[$value['user_id']]['major']) ? '' : $aReviewer[$value['user_id']]['major']; + if(empty($value['major'])){ + $sFourMsg = 'The Reviewer\'s required information is incomplete'; + $iFourStatus = 2; + break; + } + $value['company'] = empty($aReviewer[$value['user_id']]['company']) ? '' : $aReviewer[$value['user_id']]['company']; + if(empty($value['company'])){ + $sFourMsg = 'The Reviewer\'s required information is incomplete'; + $iFourStatus = 2; + break; + } + $value['department'] = empty($aReviewer[$value['user_id']]['department']) ? '' : $aReviewer[$value['user_id']]['department']; + if(empty($value['department'])){ + $sFourMsg = 'The Reviewer\'s required information is incomplete'; + $iFourStatus = 2; + break; + } + $value['country'] = empty($aReviewer[$value['user_id']]['country']) ? '' : $aReviewer[$value['user_id']]['country']; + $value['urr_id'] = empty($aUserRecommend[$value['user_id']]) ? 0 : $aUserRecommend[$value['user_id']]; + $aUser[$key] = $value; + } + } + } + } } // } @@ -5509,12 +5557,15 @@ class Article extends Base } //获取文章ID $iArticleId = empty($aParam['article_id']) ? 0 : $aParam['article_id']; + $iJournalId = empty($aParam['journal']) ? 0 : $aParam['journal']; + if(!empty($iJournalId)){ + $aParam['journal_id'] = $iJournalId; + } if(empty($iArticleId)){ $sTitle = empty($aParam['title']) ? '' : $aParam['title']; - $iJournalId = empty($aParam['journal_id']) ? 0 : $aParam['journal_id']; - if(empty($iJournalId)){ - return json_encode(['status' => 2,'msg' => 'Please select a journal']); - } + // if(empty($iJournalId)){ + // return json_encode(['status' => 2,'msg' => 'Please select a journal']); + // } $aArticleInsert = ['journal_id' => $iJournalId,'title' => $sTitle,'state' => -1,'user_id' => $iUserId]; $aArticleInsert['is_use_ai'] = 3; $aArticleInsert['is_figure_copyright'] = 3; @@ -5604,7 +5655,6 @@ class Article extends Base } //获取期刊编辑 //期刊ID - $iJournalId = empty($aParam['journal_id']) ? 0 : $aParam['journal_id']; if(!empty($iJournalId)){ //查询期刊信息 $aJournalWhere = ['journal_id' => $iJournalId,'state' => 0];