diff --git a/application/api/controller/Monitor.php b/application/api/controller/Monitor.php index 19122d8..61d4950 100644 --- a/application/api/controller/Monitor.php +++ b/application/api/controller/Monitor.php @@ -457,6 +457,59 @@ class Monitor extends Base return jsonSuccess($res); } + + public function getPublicStagesForEditor(){ + $data = $this->request->post(); + $rule = new Validate([ + "journal_id"=>"require", + "year"=>"require" + ]); + if(!$rule->check($data)){ + return jsonError($rule->getError()); + } + $journal = $this->journal_obj->where("journal_id",$data['journal_id'])->find(); + $url = "http://journalapi.tmrjournals.com/public/index.php/master/Journal/getArticleCountForSubmission"; + $program['issn'] = $journal['issn']; + $program['year'] = $data['year']; + $res = object_to_array(json_decode(myPost($url,$program))); + $re['list'] = $res['data']['stages']; + return jsonSuccess($re); + } + + + public function getArticleCountCiteForEditor(){ + $data = $this->request->post(); + $rule = new Validate([ + "article_id"=>"require" + ]); + if(!$rule->check($data)){ + return jsonError($rule->getError()); + } + $url = "http://journalapi.tmrjournals.com/public/index.php/master/Journal/getArticleCountCiteForSubmission"; + $program['article_id'] = $data['article_id']; + $res = object_to_array(json_decode(myPost($url,$program))); + $re['list'] = isset($res['data']['cites'])?$res['data']['cites']:null; + return jsonSuccess($re); + } + + + + public function getArticleCountRelatedForEditor(){ + $data = $this->request->post(); + $rule = new Validate([ + "article_id"=>"require" + ]); + if(!$rule->check($data)){ + return jsonError($rule->getError()); + } + + $url = "http://journalapi.tmrjournals.com/public/index.php/master/Journal/getArticleCountRelatedForSubmission"; + $program['article_id'] = $data['article_id']; + $res = object_to_array(json_decode(myPost($url,$program))); + $re['list'] = isset($res['data']['list'])?$res['data']['list']:null; + return jsonSuccess($re); + } + public function getCiteForChief(){ $journal_list = $this->journal_obj ->field("t_journal.issn,t_journal.abbr,t_journal.title,t_journal.editor_id,t_user.realname") @@ -471,6 +524,9 @@ class Monitor extends Base } + + + /**获取期刊青年编委 * @return void */ diff --git a/application/api/controller/Ucenter.php b/application/api/controller/Ucenter.php index 5dc2fc3..5ca79aa 100644 --- a/application/api/controller/Ucenter.php +++ b/application/api/controller/Ucenter.php @@ -65,6 +65,7 @@ class Ucenter extends Base{ if($isAuthor){ $userInfo['asAuthor'] = self::getAsAuthor($baseInfo['user_id']); } + $userInfo['Author'] = self::getAsAuthorNew($baseInfo['user_id']); //审稿人 @@ -499,6 +500,55 @@ class Ucenter extends Base{ return $res; } + + private function getAsAuthorNew($userId){ + $user_info = $this->user_obj->where("user_id",$userId)->find(); + $flag = []; + //推荐总数 + if($user_info['code']!=''){ + $tj_num = $this->article_obj->where("code",$user_info['code'])->count(); + }else{ + $tj_num = 0 ; + } + $flag['tj'] = $tj_num; + + //获取作为提交者的文章 + $ids1 = $this->article_obj->where("t_article.user_id",$userId)->column("article_id"); + + //获取作为作者的文章 + $ids2 = $this->article_author_obj->where("email",$user_info['email'])->where("state",0)->column("article_id"); + + $ids = array_unique(array_merge($ids1,$ids2)); + $articles = $this->article_obj + ->field("t_article.*,t_journal.title as journal_title,t_journal.abbr") + ->join("t_journal","t_journal.journal_id = t_article.journal_id","left") + ->whereIn("t_article.article_id",$ids) + ->select(); + + foreach ($articles as $k => $v){ + $role = []; + if($v['user_id'] == $user_info['user_id']){ + $role[] = "user"; + } + $author_check = $this->article_author_obj->where("email",$user_info['email'])->where("article_id",$v['article_id'])->where("state",0)->find(); + if($author_check){ + $role[] = "author"; + } + $articles[$k]['role'] = $role; + if($v['state']==5){ + $check = $this->production_article_obj->where("article_id",$v['article_id'])->where("state",2)->find(); + if($check){ + $articles[$k]['link'] = "https://doi.org/10.53388/".$check['doi']; + } + } + } + $flag['articles'] = $articles; + + return $flag; + } + + + public function getMajor(){ $data = $this->request->post(); $rule = new Validate([ diff --git a/application/api/controller/User.php b/application/api/controller/User.php index 09e9a27..3bda1d5 100644 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -102,6 +102,48 @@ class User extends Base } } + + public function authorDatabase(){ + $data = $this->request->post(); + $rule = new Validate([ + "limit"=>"require", + "page"=>"require" + ]); + if(!$rule->check($data)){ + return jsonError($rule->getError()); + } + $where = []; + if(isset($data['keywords'])&&$data['keywords']!=''){ + $where['email'] = ["like","%".trim($data['keywords'])."%"]; + }else{ + $where['email'] = ["<>",""]; + } + $authors = $this->article_author_obj->where($where)->group("email")->order("art_aut_id desc")->page($data['page'],$data['limit'])->select(); + $count = $this->article_author_obj->where($where)->group("email")->order("art_aut_id desc")->count(); + foreach ($authors as $k =>$v){ + $articles = $this->article_author_obj + ->field("t_article_author.*,t_article.title") + ->join("t_article","t_article.article_id = t_article_author.article_id","left") + ->where("t_article_author.email",$v['email']) + ->where("t_article_author.state",0) + ->select(); + foreach ($articles as $key=>$val){ + if($val['state']==5){ + $check = $this->production_article_obj->where("article_id",$v['article_id'])->where("state",2)->find(); + if($check){ + $articles[$key]['link'] = "https://doi.org/10.53388/".$check['doi']; + } + } + } + $authors[$k]['articles'] = $articles; + $authors[$k]['user'] = $this->user_obj->join("t_user_reviewer_info","t_user_reviewer_info.reviewer_id = t_user.user_id")->where("t_user.email",$v['email'])->find(); + } + $re['list'] = $authors; + $re['count'] = $count; + + return jsonSuccess($re); + } + /** * 增加青年科学家 */