diff --git a/application/api/controller/Preaccept.php b/application/api/controller/Preaccept.php index 1141e20..603a071 100644 --- a/application/api/controller/Preaccept.php +++ b/application/api/controller/Preaccept.php @@ -37,14 +37,17 @@ class Preaccept extends Base } $dois = $this->production_article_refer_obj->where("p_article_id", $production_info['p_article_id'])->where("refer_doi","<>","")->where("state",0)->group("refer_doi")->having("count(*)>1")->column("refer_doi"); $list = $this->production_article_refer_obj->where("p_article_id", $production_info['p_article_id'])->where('state', 0)->order("index")->select(); + $aRepeat = []; foreach ($list as $k => $v){ if(in_array($v['refer_doi'],$dois)){ $list[$k]['is_repeat'] = 1; + $aRepeat[$v['refer_doi']][] = $v['index']; }else{ $list[$k]['is_repeat'] = 0; } } $re["refers"] = $list; + $re['repeat'] = empty($aRepeat) ? [] : $aRepeat; return jsonSuccess($re); } diff --git a/application/api/controller/Production.php b/application/api/controller/Production.php index 769f20f..38c2a99 100644 --- a/application/api/controller/Production.php +++ b/application/api/controller/Production.php @@ -592,14 +592,17 @@ class Production extends Base $this->refuseReferIndex($data['p_article_id']); $dois = $this->production_article_refer_obj->where("p_article_id", $data['p_article_id'])->where("refer_doi","<>","")->where("state",0)->group("refer_doi")->having("count(*)>1")->column("refer_doi"); $list = $this->production_article_refer_obj->where('p_article_id', $data['p_article_id'])->where('state', 0)->order("index")->select(); + $aRepeat = []; foreach ($list as $k => $v){ if(in_array($v['refer_doi'],$dois)){ $list[$k]['is_repeat'] = 1; + $aRepeat[$v['refer_doi']][] = $v['index']; }else{ $list[$k]['is_repeat'] = 0; } } $re['refers'] = $list; + $re['repeat'] = empty($aRepeat) ? [] : $aRepeat; return jsonSuccess($re); } diff --git a/application/api/controller/Workbench.php b/application/api/controller/Workbench.php index 1eb8431..651f516 100644 --- a/application/api/controller/Workbench.php +++ b/application/api/controller/Workbench.php @@ -45,7 +45,7 @@ class Workbench extends Base //标题 $sTitle = empty($aParam['title']) ? '': $aParam['title']; if(!empty($sTitle)){ - $aWhere = ['title' => trim($sTitle)]; + $aWhere = ['title' => ['like','%'.trim($sTitle).'%']]; } //国家 $sCountry = -1; @@ -400,4 +400,67 @@ class Workbench extends Base Db::commit(); return json_encode(['status' => 1,'msg' => 'Update successful']); } + + /** + * 获取审稿记录详情 + */ + public function getArticleReviewDetail(){ + //获取参数 + $aParam = empty($aParam) ? $this->request->post() : $aParam; + //获取文章ID + $iArticleId = empty($aParam['article_id']) ? 0 : $aParam['article_id']; + if(empty($iArticleId)){ + return json_encode(['status' => 2,'msg' => 'Please select the article']); + } + + //获取审稿记录ID + $iArtRevId = empty($aParam['art_rev_id']) ? 0 : $aParam['art_rev_id']; + if(empty($iArtRevId)){ + return json_encode(['status' => 2,'msg' => 'Please select a record']); + } + //获取复审记录ID + $iArtRevRepId = empty($aParam['art_rev_rep_id']) ? 0 : $aParam['art_rev_rep_id']; + if(empty($iArtRevId) && empty($iArtRevRepId)){ + return json_encode(['status' => 2,'msg' => 'Please select a record']); + } + + //查询文章 + $aArticle = json_decode($this->get($aParam),true); + $iStatus = empty($aArticle['status']) ? 0 : $aArticle['status']; + if($iStatus != 1){ + return json_encode($aArticle); + } + $aArticle = empty($aArticle['data']) ? [] : $aArticle['data']; + + //查询审稿记录 + $aWhere = ['art_rev_id' => $iArtRevId,'article_id' => $iArticleId]; + $aArticleReviewer = Db::name('article_reviewer')->field('art_rev_id,reviewer_id,ctime')->where($aWhere)->find(); + if(empty($aArticleReviewer)){ + return json_encode(['status' => 3,'msg' => 'Review record does not exist']); + } + if(empty($iArtRevRepId)){ + //查询初审问卷 + $aWhere = ['art_rev_id' => $iArtRevId]; + $aQuestion = Db::name('article_reviewer_question')->field('is_anonymous')->where($aWhere)->find(); + $aArticleReviewer['is_anonymous'] = empty($aQuestion['is_anonymous']) ? 0 : $aQuestion['is_anonymous']; + } + //查询审稿人姓名 + $iUserId = empty($aArticleReviewer['reviewer_id']) ? 0 : $aArticleReviewer['reviewer_id']; + if(!empty($iUserId)){ + $aWhere = ['user_id' => $iUserId,'state' => 0]; + $aUser = Db::name('user')->field('realname,email')->where($aWhere)->find(); + $aArticleReviewer['realname'] = empty($aUser['realname']) ? '' : $aUser['realname']; + $aArticleReviewer['email'] = empty($aUser['email']) ? '' : $aUser['email']; + } + + //组装信息 + $aData = ['article' => $aArticle,'article_reviewer' => $aArticleReviewer]; + //查询复审信息 + if(!empty($iArtRevRepId)){ + //查询初审问卷 + $aWhere = ['art_rev_id' => $iArtRevId,'art_rev_rep_id' => $iArtRevRepId]; + $aData['article_reviewer_repeat'] = Db::name('article_reviewer_repeat')->where($aWhere)->find(); + } + return json_encode(['status' => 1,'msg' => 'success','data' => $aData]); + } }