From 7b0edf5da5482f3f44520ae1b586d108380b2f69 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Mon, 28 Feb 2022 10:00:50 +0800 Subject: [PATCH] 20201112 --- application/api/controller/Article.php | 72 +++++++---- application/api/controller/Auto.php | 2 +- application/api/controller/Reviewer.php | 37 ++++-- application/api/controller/User.php | 152 +++++++++++++++++++++++- application/common.php | 92 +++++++++----- application/extra/doc.php | 2 + 6 files changed, 289 insertions(+), 68 deletions(-) diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index 5c9a2bd..a3aa6f9 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -460,16 +460,9 @@ class Article extends Controller { $transfer_list = $this->article_transfer_obj->where('article_id',$data['articleId'])->where('state',0)->select(); $user_info = $this->user_obj->where(['user_id' => $article_info['user_id']])->find(); $user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id",$user_info['user_id'])->find(); -// $sn_content = '';//显示接收sn信息 -// -// //接受文章时,生成流水号 -// if ($article_info['state'] == 0 && $data['state'] == 1) { -// $update_data['accept_sn'] = getArticleSN($journal_info['abbr'],$article_info['type']); -// $sn_content .= 'your Manuscript ID: '.$update_data['accept_sn'].' '; -// } - if($data['state']==3 && count($transfer_list)>0){ + if($data['state']==3 && count($transfer_list)>0){//拒绝转投 //查询转投期刊信息 $transfer_journal = $this->journal_obj->where('journal_id',$transfer_list[0]['journal_id'])->find(); //转投 @@ -514,17 +507,6 @@ class Article extends Controller { return json(['code'=>0]); }else{ - //添加文章状态信息(如果状态未更新可做通话用,并结束操作) - $insert_data['article_id'] = $data['articleId']; - $insert_data['content'] = $data['editormsg']; - $insert_data['state_from'] = $article_info['state']; - $insert_data['state_to'] = $data['state']; - $insert_data['ctime'] = time(); - $this->article_msg_obj->insert($insert_data); - if ($article_info['state'] == $data['state']) { - $this->article_obj->where($where_article)->update(['editor_act'=>1]); - return json(['code' => 0]); - } //接收文章,必须有两个及以上的大于40个字的对作者的评论,除去news和comment类型的文章 if($data['state']==5&&$article_info['type']!="N"&&$article_info['type']!="T"){ //定义符合条件的数量 @@ -537,12 +519,13 @@ class Article extends Controller { ->where('t_article_reviewer.state','in',[1,3]) ->select(); foreach ($rev_list as $v){ - if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $v['comments'])>0){//含有中文 - if(mb_strlen($v['comments'], 'UTF8')>=60){ + $content = $v['qu9_contents']." ".$v['qu10_contents']." ".$v['qu11_contents']." ".$v['qu12_contents']." ".$v['qu13_contents']." ".$v['qu14_contents']." ".$v['qu15_contents']." ".$v['comments']; + if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $content)>0){//含有中文 + if(mb_strlen($content, 'UTF8')>=60){ $rev_real_num++; } }else{//不含中文 - $carray = explode(" ", $v['comments']); + $carray = explode(" ", $content); if(count($carray)>=40){ $rev_real_num++; } @@ -552,6 +535,18 @@ class Article extends Controller { return json(['code'=>1,'msg'=>"More than two available reviewer-comments are necessary before going next step."]); } } + + //添加文章状态信息(如果状态未更新可做通话用,并结束操作) + $insert_data['article_id'] = $data['articleId']; + $insert_data['content'] = $data['editormsg']; + $insert_data['state_from'] = $article_info['state']; + $insert_data['state_to'] = $data['state']; + $insert_data['ctime'] = time(); + $this->article_msg_obj->insert($insert_data); + if ($article_info['state'] == $data['state']) { + $this->article_obj->where($where_article)->update(['editor_act'=>1]); + return json(['code' => 0]); + } $update_data['state'] = $data['state']; $update_data['editor_act'] = 1; //更新文章状态 @@ -861,7 +856,7 @@ class Article extends Controller { $tt .= $journal_info['title'].'
'; $tt .= 'Email:'.$journal_info['email'].'
'; $tt .= 'Website:'.$journal_info['website']; -// sendEmail($reviewer_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']); + sendEmail($reviewer_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']); //记录userlog $log_data['user_id'] = $article_info['editor_id']; @@ -1060,6 +1055,9 @@ class Article extends Controller { //增加usermsg $res_msg = add_usermsg($journal_info['editor_id'], 'New manuscript', '/articleDetailEditor?id=' . $res); + + //通讯作者转为审稿人 + $this->addReviewerFromArticle($res, $journal_info['journal_id']); if ($res && $res_author && $transr && $res_file1 && $res_file2 && $res_file3 && $res_file4 && $res_log && $res_msg) { Db::commit(); @@ -1070,6 +1068,28 @@ class Article extends Controller { } } + + +// public function cfreviewer(){ +// $list = $this->article_author_obj->where("is_report",1)->select(); +// foreach ($list as $v){ +// $ar = $this->article_obj->where("article_id",$v['article_id'])->find(); +// if(!$ar){ +// continue; +// } +// $this->addReviewerFromReportAuthor($v['art_aut_id'], $ar['journal_id']); +// } +// echo 'ok'; +// } + + + private function addReviewerFromArticle($article_id,$journal_id){ + $list = $this->article_author_obj->where('article_id',$article_id)->where('is_report',1)->where('state',0)->select(); + foreach ($list as $v){ + $this->addReviewerFromReportAuthor($v['art_aut_id'], $journal_id); + } + } + /** * 添加审稿人来自通讯作者 */ @@ -1080,6 +1100,12 @@ class Article extends Controller { if(!preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/",$author_info['email'])){ return ; } + + $check = $this->reviewer_from_author_obj->where('art_aut_id',$art_aut_id)->where('journal_id',$journal_id)->find(); + if($check){ + return ; + } + //判断目前的状态进行下一步流程 $user_info = $this->user_obj->where('email',$author_info['email'])->where('state',0)->find(); if($user_info==null){//不存在用户 diff --git a/application/api/controller/Auto.php b/application/api/controller/Auto.php index d2e1b2f..2aff4b7 100644 --- a/application/api/controller/Auto.php +++ b/application/api/controller/Auto.php @@ -116,7 +116,7 @@ class Auto extends Controller { $tt .= 'Website:' . $cache_journal['website'] . ''; $maidata['email'] = $cache_author['email']; - $maidata['title'] = "Deadline for your revision of " . $cache_journal['title'] . " -Reminder"; + $maidata['title'] = "Revision Due Date-" . $cache_journal['title']; $maidata['content'] = $tt; $maidata['tmail'] = $cache_journal['email']; $maidata['tpassword'] = $cache_journal['epassword']; diff --git a/application/api/controller/Reviewer.php b/application/api/controller/Reviewer.php index 6a632f5..6928358 100644 --- a/application/api/controller/Reviewer.php +++ b/application/api/controller/Reviewer.php @@ -137,12 +137,15 @@ class Reviewer extends Controller { $data = $this->request->post(); $limit_start = ($data['pageIndex'] - 1) * $data['pageSize']; $reviewer_info = $this->user_obj->where('user_id', $data['user_id'])->find(); - $res = $this->article_reviewer_obj->field('t_article_reviewer.*,t_article.article_id,t_article.journal_id,t_article.major_id,t_article.abstrart,t_article.cmajor_id,t_article.state astate,t_article.title article_title,t_article.type,t_journal.title journal_title,t_article.accept_sn accept_sn') + $res = $this->article_reviewer_obj + ->field('t_article_reviewer.*,t_article.article_id,t_article.journal_id,t_article.major_id,t_article.abstrart,t_article.cmajor_id,t_article.state astate,t_article.title article_title,t_article.type,t_journal.title journal_title,t_article.accept_sn accept_sn,t_article_reviewer_question.recommend,t_article_reviewer_question.ctime recommenttime') ->join('t_article', 't_article_reviewer.article_id = t_article.article_id', 'LEFT') ->join('t_journal', 't_article.journal_id = t_journal.journal_id', 'LEFT') + ->join("t_article_reviewer_question","t_article_reviewer_question.art_rev_id = t_article_reviewer.art_rev_id","left") ->where('t_article_reviewer.reviewer_id', $reviewer_info['user_id']) ->where('t_article_reviewer.state', 'in', [1, 2, 3, 4]) - ->order('t_article_reviewer.state') + ->where("t_article.article_id",">",0) +// ->order('t_article_reviewer.state') ->limit($limit_start, $data['pageSize']) ->select(); foreach ($res as $k => $v) { @@ -159,7 +162,7 @@ class Reviewer extends Controller { $res[$k]['cmajor'] = $cmajor['title']; } - $count = $this->article_reviewer_obj->where('reviewer_id', $reviewer_info['user_id'])->where('state', 'in', [1, 2, 3, 4])->count(); + $count = $this->article_reviewer_obj->join('t_article', 't_article_reviewer.article_id = t_article.article_id', 'LEFT')->where('t_article_reviewer.reviewer_id', $reviewer_info['user_id'])->where('t_article_reviewer.state', 'in', [1, 2, 3, 4])->where("t_article.article_id",">",0)->count(); $re['lists'] = $res; $re['count'] = $count; return jsonSuccess($re); @@ -677,13 +680,13 @@ class Reviewer extends Controller { $tt = 'Dear editor,
'; $tt .= 'Please check the new comments from the reviewer.
'; $tt .= 'Journal:' . $journal_info['title'] . ' and article title:' . $article_info['title']; -// sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']); + sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']); //发送email感谢reviewer并携带附件 $reviewer_info = $this->user_obj->where('user_id', $art_rev_info['reviewer_id'])->find(); $tt1 = 'You have reviewed 1 submission in the journal ' . $journal_info['title'] . ' during ' . date('Y') . '.Thank you for your support to our journal. This contribution is greatly appreciated.

'; $tt1 .= 'Regards
Editorial Office
' . $journal_info['title'] . '

'; $tt1 .= 'Contact us
TMR Publishing Group Address: 11 Cockle Bay Rd, Cockle Bay, Auckland 2014, New Zealand
Telephone: +64 02108293806
E-mail: publisher@tmrjournals.com'; -// sendEmail($reviewer_info['email'], 'Your contribution is greatly appreciated', $journal_info['title'], $tt1, $journal_info['email'], $journal_info['epassword'], $reviewer_ZS); + sendEmail($reviewer_info['email'], 'Your contribution is greatly appreciated', $journal_info['title'], $tt1, $journal_info['email'], $journal_info['epassword'], $reviewer_ZS); //记录usermsg add_usermsg($journal_info['editor_id'], 'Feedback questionnaire be uploaded.', '/articleReviewerDetail?id=' . $data['art_rev_id']); @@ -905,7 +908,7 @@ class Reviewer extends Controller { $tt .= $journal_info['title'] . '
'; $tt .= 'Email:' . $journal_info['email'] . '
'; $tt .= 'Website:' . $journal_info['website']; -// sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']); + sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']); $re['art_rev_id'] = $res; return jsonSuccess($re); @@ -1306,6 +1309,25 @@ class Reviewer extends Controller { $this->user_reviewer_info_obj->where("reviewer_id", $data['user_id'])->update($info_insert); return jsonSuccess([]); } + + +// public function addtest(){ +// $list = $this->reviewer_to_journal_obj +// ->field("t_reviewer_to_journal.*,t_user_reviewer_info.reviewer_info_id") +// ->join("t_user_reviewer_info","t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id","left") +// ->where("t_reviewer_to_journal.state",0) +// ->select(); +// echo '
';
+//        
+//        foreach ($list as $v){
+//            if($v['reviewer_info_id']!=null){
+//                continue;
+//            }
+//            var_dump($v);
+//        }
+//        
+//        echo '
'; +// } /** * @title 获取审稿人列表 @@ -1531,10 +1553,11 @@ class Reviewer extends Controller { $data = $this->request->post(); $list = $this->article_reviewer_obj ->where("article_id", $data['article_id']) - ->where("state", "in", [2, 3]) + ->where("state", "in", [1, 2, 3]) ->select(); foreach ($list as $k => $v) { $list[$k]["question"] = $this->article_reviewer_question_obj->where("art_rev_id", $v['art_rev_id'])->find(); + $list[$k]['reviewer'] = $this->user_obj->where("user_id",$v['reviewer_id'])->find(); } $re["reviews"] = $list; diff --git a/application/api/controller/User.php b/application/api/controller/User.php index 888a75d..30cb458 100644 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -26,6 +26,8 @@ class User extends Controller { protected $user_msg_obj = ''; protected $chief_to_journal_obj = ''; protected $board_to_journal_obj = ''; + protected $reviewer_from_author_obj = ''; + protected $article_author_obj = ''; public function __construct(\think\Request $request = null) { parent::__construct($request); @@ -41,6 +43,8 @@ class User extends Controller { $this->user_msg_obj = Db::name('user_msg'); $this->chief_to_journal_obj = Db::name('chief_to_journal'); $this->board_to_journal_obj = Db::name('board_to_journal'); + $this->reviewer_from_author_obj = Db::name('reviewer_from_author'); + $this->article_author_obj = Db::name('article_author'); } /** @@ -336,7 +340,7 @@ class User extends Controller { $tt .= "Username:$account
"; $tt .= "Password:" . $data['password'] . '

'; $tt .= "Many thanks
TMR Publishing Group"; - sendEmail($email, 'Dear ' . $data['name'], 'TMR', $tt,); + sendEmail($email, 'Dear ' . $data['name'], 'TMR', $tt); return json($inser_data); } @@ -556,15 +560,155 @@ class User extends Controller { * 获取申请详情 */ public function getApplyDetail() { - $reviewerId = $this->request->post('reviewerId'); - $where['t_user_reviewer_apply.reviewer_id'] = $reviewerId; - $res = $this->user_reviewer_obj->field('t_user_reviewer_apply.*,t_journal.title journal,t_reviewer_major.title major_title')->join('t_journal', 't_journal.journal_id = t_user_reviewer_apply.journal_id', 'left')->join('t_reviewer_major', 't_user_reviewer_apply.major = t_reviewer_major.major_id', 'LEFT')->where($where)->find(); + $reviewerId = $this->request->post('reviewerApplyId'); + $where['t_user_reviewer_apply.reviewer_apply_id'] = $reviewerId; + $res = $this->user_reviewer_obj + ->field('t_user_reviewer_apply.*,t_journal.title journal,t_reviewer_major.title major_title') + ->join('t_journal', 't_journal.journal_id = t_user_reviewer_apply.journal_id', 'left') + ->join('t_reviewer_major', 't_user_reviewer_apply.major = t_reviewer_major.major_id', 'LEFT') + ->where($where) + ->find(); if ($res) { return json(['code' => 0, 'data' => $res]); } else { return json(['code' => 1]); } } + + /** + * @title 获取作者转审稿人列表 + * @description 获取作者转审稿人列表 + * @author wangjinlei + * @url /api/User/getAuthorToReviewerList + * @method POST + * + * @param name:username type:string require:1 desc:用户名 + * @param name:journal_id type:int require:1 desc:期刊id0是全部 + * + * @return reviewerTrans:列表# + */ + public function getAuthorToReviewerList(){ + $data = $this->request->post(); + $user_info = $this->user_obj->where('account',$data['username'])->find(); + $journals = $this->journal_obj->where("editor_id",$user_info['user_id'])->where('state',0)->column("journal_id"); + + $where['t_reviewer_from_author.rfa_state'] = 0; + if($data['journal_id']==0){ + $where['t_reviewer_from_author.journal_id'] = ["in",$journals]; + }else{ + $where['t_reviewer_from_author.journal_id'] = $data['journal_id']; + } + $list = $this->reviewer_from_author_obj + ->field("t_reviewer_from_author.rfa_id,t_article_author.*,t_journal.title journal_title") + ->join("t_article_author","t_reviewer_from_author.art_aut_id = t_article_author.art_aut_id","left") + ->join("t_journal","t_journal.journal_id = t_reviewer_from_author.journal_id","left") + ->where($where) + ->select(); + $re['reviewerTrans'] = $list; + return jsonSuccess($re); + } + + /** + * @title 获取作者转审稿人详情 + * @description 获取作者转审稿人详情 + * @author wangjinlei + * @url /api/User/getAuthorToReviewerDetail + * @method POST + * + * @param name:rfa_id type:int require:1 desc:实例id + * + * @return reviewerTrans:列表# + */ + public function getAuthorToReviewerDetail(){ + $data = $this->request->post(); + $detail = $this->reviewer_from_author_obj + ->field("t_reviewer_from_author.rfa_id,t_article_author.*,t_journal.title journal_title") + ->join("t_article_author","t_reviewer_from_author.art_aut_id = t_article_author.art_aut_id","left") + ->join("t_journal","t_journal.journal_id = t_reviewer_from_author.journal_id","left") + ->where("rfa_id",$data['rfa_id']) + ->find(); + + $re['reviewerTran'] = $detail; + return jsonSuccess($re); + } + + /** + * @title 作者转审稿人提交信息并通过 + * @description 作者转审稿人提交信息并通过 + * @author wangjinlei + * @url /api/User/ReviewerFromAuthorAdopt + * @method POST + * + * @param name:rfa_id type:int require:1 desc:实例id + * @param name:company type:String require:1 desc:单位 + * @param name:country type:String require:1 desc:国家 + * @param name:email type:String require:1 desc:邮箱 + * @param name:field type:String require:1 desc:领域描述 + * @param name:gender type:String require:1 desc:1男2女 + * @param name:introduction type:String require:1 desc:简介 + * @param name:major type:int require:1 desc:major_id + * @param name:qualifications type:String require:1 desc:cv地址 + * @param name:author_title type:String require:1 desc:职称 + * + * + */ + public function ReviewerFromAuthorAdopt(){ + $data = $this->request->post(); + $rfa_info = $this->reviewer_from_author_obj->where('rfa_id',$data['rfa_id'])->find(); + $journal_info = $this->journal_obj->where('journal_id',$rfa_info['journal_id'])->find(); + $art_aut_info = $this->article_author_obj->where('art_aut_id',$rfa_info['art_aut_id'])->find(); + $user_info = $this->user_obj->where('email',$art_aut_info['email'])->where('state',0)->find(); + if(!$user_info){ + return jsonError("user no find!"); + } + + Db::startTrans(); + + $insert_info['reviewer_id'] = $user_info['user_id']; + $insert_info['gender'] = $data['gender']; + $insert_info['technical'] = $data['author_title']; + $insert_info['country'] = $data['country']; + $insert_info['introduction'] = $data['introduction']; + $insert_info['company'] = $data['company']; + $insert_info['major'] = $data['major']; + $insert_info['field'] = $data['field']; + $insert_info['qualifications'] = $data['qualifications']; + $res = $this->user_reviewer_info_obj->insertGetId($insert_info); + + $insert_to['reviewer_id'] = $user_info['user_id']; + $insert_to['journal_id'] = $rfa_info['journal_id']; + $insert_to['account'] = $user_info['account']; + $insert_to['journal_title'] = $journal_info['title']; + $insert_to['ctime'] = time(); + $res1 = $this->reviewer_to_journal_obj->insertGetId($insert_to); + + $res2 = $this->reviewer_from_author_obj->where('rfa_id',$data['rfa_id'])->update(['rfa_state'=>1]); + + if($res && $res1 && $res2){ + Db::commit(); + return jsonSuccess([]); + } else { + Db::rollback(); + return jsonError("system error!"); + } + } + + /** + * @title 作者转审稿人拒绝 + * @description 作者转审稿人拒绝 + * @author wangjinlei + * @url /api/User/ReviewerFromAuthorReject + * @method POST + * + * @param name:rfa_id type:int require:1 desc:实例id + * + * + */ + public function ReviewerFromAuthorReject(){ + $data = $this->request->post(); + $this->reviewer_from_author_obj->where('rfa_id',$data['rfa_id'])->update(['rfa_state'=>2]); + return jsonSuccess([]); + } /** * 通过审核人 diff --git a/application/common.php b/application/common.php index e482f9c..4377a2a 100644 --- a/application/common.php +++ b/application/common.php @@ -2,8 +2,8 @@ use PHPMailer\PHPMailer\PHPMailer; use think\Db; -//use TCPDF; +//use TCPDF; // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- @@ -93,13 +93,13 @@ function sendEmail($email = '', $title = '', $from_name = '', $content = '', $me } function object_to_array($obj) { - $obj = (array)$obj; + $obj = (array) $obj; foreach ($obj as $k => $v) { if (gettype($v) == 'resource') { return; } if (gettype($v) == 'object' || gettype($v) == 'array') { - $obj[$k] = (array)object_to_array($v); + $obj[$k] = (array) object_to_array($v); } } return $obj; @@ -109,9 +109,9 @@ function object_to_array($obj) { * 生成文章sn号 * @return type */ -function getArticleSN($abbr,$type) { +function getArticleSN($abbr, $type) { $str = $abbr; - $str .= date('Y', time()).$type.date('md', time()); + $str .= date('Y', time()) . $type . date('md', time()); $where['accept_sn'] = ['like', "$str%"]; $nowres = Db::name('article')->where($where)->select(); $last_num = 1; @@ -127,9 +127,9 @@ function getArticleSN($abbr,$type) { return $str; } -function translateType($type){ +function translateType($type) { $frag = ''; - switch ($type){ + switch ($type) { case "A": $frag = 'Article'; break; @@ -151,9 +151,41 @@ function translateType($type){ case "T": $frag = 'Comment'; break; - case "O": - $frag = 'Others'; + case 'CT': + $frag = 'CORRECTION'; break; + case 'HT': + $frag = 'HYPOTHESIS'; + break; + case 'PF': + $frag = 'PREFACE'; + break; + case 'ET': + $frag = 'EDITORIAL'; + break; + case 'RP': + $frag = 'REPORT'; + break; + case 'EF': + $frag = 'EMPIRICAL FORMULA'; + break; + case 'EM': + $frag = 'EVIDENCE-BASED MEDICINE'; + break; + case 'EC': + $frag = 'EXPERT CONSENSUS'; + break; + case 'LTE': + $frag = 'LETTER TO EDITOR'; + break; + case 'QI': + $frag = 'QUESTIONNAIRE INVESTIGATION'; + break; + case 'PT': + $frag = 'PROTOCOL'; + break; + default: + $frag = 'OTHERS'; } return $frag; } @@ -164,9 +196,9 @@ function translateType($type){ function add_usermsg($userid, $content, $url) { $msg_obj = Db::name('user_msg'); $msg_info = $msg_obj->where('user_id', $userid) - ->where('url', $url) - ->where('state', 0) - ->find(); + ->where('url', $url) + ->where('state', 0) + ->find(); if ($msg_info) { return true; } @@ -177,59 +209,53 @@ function add_usermsg($userid, $content, $url) { return $msg_obj->insert($msgdata); } -function jsonSuccess($data){ - return json(['code'=>0,'msg'=>'success','data'=>$data]); +function jsonSuccess($data) { + return json(['code' => 0, 'msg' => 'success', 'data' => $data]); } -function jsonError($msg){ - return json(['code'=>1,'msg'=>$msg]); +function jsonError($msg) { + return json(['code' => 1, 'msg' => $msg]); } -function choiseJabbr($article_id,$jabbr){ - if($article_id<1799&&$jabbr=="Cancer Adv"){ +function choiseJabbr($article_id, $jabbr) { + if ($article_id < 1799 && $jabbr == "Cancer Adv") { return "TMR Cancer"; } - if($article_id<910&&$jabbr=="Microenviron Microecol Res"){ + if ($article_id < 910 && $jabbr == "Microenviron Microecol Res") { return "Tumor Microenviron Res"; } - if($article_id<1799&&$jabbr=="Med Theor Hypothesis"){ + if ($article_id < 1799 && $jabbr == "Med Theor Hypothesis") { return "TMR Theory Hypoth"; } return $jabbr; } -function myPost($url, $param=array()){ +function myPost($url, $param = array()) { - if(!is_array($param)){ + if (!is_array($param)) { throw new Exception("参数必须为array"); - } - $httph =curl_init($url); + $httph = curl_init($url); // curl_setopt($httph, CURLOPT_SSL_VERIFYPEER, 0); - // curl_setopt($httph, CURLOPT_SSL_VERIFYHOST, 1); - curl_setopt($httph,CURLOPT_RETURNTRANSFER,1); + curl_setopt($httph, CURLOPT_RETURNTRANSFER, 1); curl_setopt($httph, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"); - curl_setopt($httph, CURLOPT_POST, 1);//设置为POST方式 + curl_setopt($httph, CURLOPT_POST, 1); //设置为POST方式 curl_setopt($httph, CURLOPT_POSTFIELDS, $param); // curl_setopt($httph, CURLOPT_RETURNTRANSFER,0); - // curl_setopt($httph, CURLOPT_HEADER,1); - $rst=curl_exec($httph); + $rst = curl_exec($httph); curl_close($httph); return $rst; - - } - - +} diff --git a/application/extra/doc.php b/application/extra/doc.php index c61fc5e..0503ae4 100644 --- a/application/extra/doc.php +++ b/application/extra/doc.php @@ -15,6 +15,8 @@ return [ 'app\api\controller\User', 'app\api\controller\Article', 'app\api\controller\Major', + 'app\api\controller\Admin', + 'app\api\controller\Journal', ], 'filter_method' => [ //过滤 不解析的方法名称