From a786f6f8e52d11e358e9ddeb745376df16fcd616 Mon Sep 17 00:00:00 2001 From: Administrator Date: Tue, 11 Jan 2022 16:31:53 +0800 Subject: [PATCH] --- application/api/controller/Article.php | 61 +- application/api/controller/Auto.php | 73 ++ application/api/controller/Chief.php | 2 +- application/api/controller/Major.php | 177 +++++ application/api/controller/Reviewer.php | 903 +++++++++++++++--------- application/api/controller/Super.php | 23 + application/api/controller/User.php | 5 +- 7 files changed, 899 insertions(+), 345 deletions(-) create mode 100644 application/api/controller/Major.php diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index 68eb20f..a6fc5a9 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -5,6 +5,10 @@ namespace app\api\controller; use think\Controller; use think\Db; +/** + * @title 文章接口 + * @description 文章接口 + */ class Article extends Controller { protected $article_obj = ''; @@ -78,7 +82,22 @@ class Article extends Controller { } /** - * 获取文章列表(编辑) + * @title 获取文章列表(编辑) + * @description 获取文章列表(编辑) + * @author wangjinlei + * @url /api/Article/getArticleForEditor + * @method POST + * + * @param name:username type:string require:1 desc:编辑用户名 + * @param name:journal type:int require:1 desc:期刊id + * @param name:state type:int require:1 desc:状态 + * @param name:act type:int require:1 desc:1进行中2已完成 + * @param name:sn type:string require:0 desc:流水号 + * @param name:pageIndex type:int require:1 desc:当前页码 + * @param name:pageSize type:int require:1 desc:每个页面的数据条数 + * + * @return articles:文章列表# + * @return count:总数# */ public function getArticleForEditor() { //接受参数 @@ -101,6 +120,9 @@ class Article extends Controller { $where['t_article.state'] = array('in',[3,5]); } } + if(isset($data['sn'])&& trim($data['sn'])!=""){ + $where["t_article.accept_sn"] = trim($data['sn']); + } if ($data['name'] != '') { $where['t_article.title'] = array('like', "%" . $data['name'] . "%"); } @@ -246,6 +268,7 @@ class Article extends Controller { $where['article_id'] = $data['articleId']; $up_res = $this->article_obj->where($where)->update($inset_data); $article_info = $this->article_obj->where($where)->find(); + $journal_info = $this->journal_obj->where("journal_id",$article_info["journal_id"])->find(); //更新作者信息 $aids = []; @@ -321,7 +344,7 @@ class Article extends Controller { $log_res=$this->user_log_obj->insert($log_data); //增加usermsg - $umsg_res=add_usermsg($article_info['editor_id'], 'The manuscript has new process: ' . $article_info['title'], '/articleDetailEditor?id=' . $article_info['article_id']); + $umsg_res=add_usermsg($journal_info['editor_id'], 'The manuscript has new process: ' . $article_info['title'], '/articleDetailEditor?id=' . $article_info['article_id']); if($up_res&&$msg_res&&$res1&&$res2&&$res3&&$res4&&$log_res&&$umsg_res){ Db::commit(); @@ -380,10 +403,11 @@ class Article extends Controller { sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt,$journal_info['email'],$journal_info['epassword']); //添加usermsg - add_usermsg($article_info['editor_id'], 'Manuscript authors be changed,please contact the author to confirm.', 'articleDetailEditor?id='.$data['articleId']); + add_usermsg($journal_info['editor_id'], 'Manuscript authors be changed,please contact the author to confirm.', 'articleDetailEditor?id='.$data['articleId']); return json(['code' => 0]); } + /** * 修改文章状态(编辑) @@ -433,7 +457,7 @@ class Article extends Controller { $tt .= $article_info['accept_sn'].'
'; $tt .= 'journal:'.$journal_info['title'].'
'; - $tt .= 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?'Authors':$user_info['realname']).',
'; + $tt .= 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
'; $tt .= 'Thank you for submitting your paper to '.$journal_info['title'].'. Your manuscript has undergone review.
'; $tt .= 'Unfortunately the editors feel that '.$journal_info['title'].' is not the appropriate venue for your manuscript. You munuscript will transfer to journal - '.$tran_journal['title'].' as you co-submitting chose order.If you have questions about the Co-submission process, please contact publisher@tmrjournals.com within 48 hours.

Yours sincerely,

'; $tt .= 'Sincerely,
Editorial Office
'; @@ -464,9 +488,15 @@ class Article extends Controller { $this->article_obj->where($where_article)->update(['editor_act'=>1]); return json(['code' => 0]); } - //更新文章状态 $update_data['state'] = $data['state']; $update_data['editor_act'] = 1; + //更新文章状态 + if($data['state']==4){ + $update_data['ttime'] = time(); + } + if($data['state']==3){ + $update_data['rstime'] = time(); + } $this->article_obj->where($where_article)->update($update_data); } @@ -477,7 +507,7 @@ class Article extends Controller { $tt = '"'.$article_info['title'].'"
'; $tt .= $article_info['accept_sn'].'
'; $tt .= 'journal:'.$journal_info['title'].'
'; - $tt .= 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?'Authors':$user_info['realname']).',
'; + $tt .= 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
'; $tt .= 'Thank you for submitting your paper to '.$journal_info['title'].'. Your manuscript has undergone review.
'; $tt .= 'Unfortunately the editors feel that '.$journal_info['title'].' is not the appropriate venue for your manuscript,' . ' and we are returning your manuscript to you so that you can submit it to another journal without delay. ' @@ -512,23 +542,23 @@ class Article extends Controller { $tt = 'Manuscript ID: '.$article_info['accept_sn'].'
'; $tt .= 'Manuscript Title: '.$article_info['title'].'
'; $tt .= 'Authors’ Name: '.self::getArticleAuthors($article_info['article_id']).'

'; - $tt .= 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?'Authors':$user_info['realname']).',
It is a distinct pleasure to inform you that your manuscript has been accepted for publication in '.$journal_info['title'].' (ISSN '.$journal_info['issn'].').
The editor will contact you further by email soon.


'; + $tt .= 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
It is a distinct pleasure to inform you that your manuscript has been accepted for publication in '.$journal_info['title'].' (ISSN '.$journal_info['issn'].').
The editor will contact you further by email soon.


'; $tt .= 'Sincerely,
Editorial Office
'; }else if($data['state']==4){//退修 $tt = $article_info['accept_sn'].'
'; - $tt .= 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?'Authors':$user_info['realname']).',
'; + $tt .= 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
'; $tt .= 'Thank you for submitting the manuscript to '.$journal_info['title'].'.
'; $tt .= 'Please find the new comments in the "Author Center", Please submit your revised manuscript within two weeks.

'; $tt .= 'If you need more time to revise, you can send E-mial to tell us.
'; $tt .= 'Sincerely,
Editorial Office
'; }else if($data['state']==6){//终审 - $tt = 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?'Authors':$user_info['realname']).',
'; + $tt = 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
'; $tt .= 'Manuscript status: Your manuscript "'.$article_info['title'].'" is under reviewing by editorial member team of '.$journal_info['title'].'.'; }else{ $tt = '"'.$article_info['title'].'"
'; $tt .= $article_info['accept_sn'].'
'; $tt .= 'journal:'.$journal_info['title'].'

'; - $tt .= 'Dear '.($user_info['realname']==''?'Authors':$user_info['realname']).',
Please check the new status of your manuscript online.

'; + $tt .= 'Dear '.($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
Please check the new status of your manuscript online.

'; } $tt .= $journal_info['title'].'
'; $tt .= 'Subscribe to this journal
'; @@ -818,7 +848,12 @@ class Article extends Controller { } $journal_info = $this->journal_obj->where('journal_id', $data['journal'])->find(); - + + //首先查重是否重复投稿 + $checkArticle = $this->article_obj->where("title",trim($data['title']))->find(); + if($checkArticle!=null){ + return json(['code'=>1,'msg'=>'Warning: you re-submitting the article!']); + } Db::startTrans(); //添加文章基础信息 @@ -890,7 +925,7 @@ class Article extends Controller { sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt,$journal_info['email'],$journal_info['epassword']); $user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id",$user_res['user_id'])->find(); //发送邮件给作者,表示感谢 - $tt1 = 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_res['realname']==''?'Authors':$user_res['realname']).',

'; + $tt1 = 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_res['realname']==''?$user_res['account']:$user_res['realname']).',

'; $tt1 .= 'Thank you for submitting your manuscript entitled "'.$data['title'].'". Your submission has been assigned the following tracking number:'.$inset_data['accept_sn'].'. We will be in touch again as soon as we have reached a decision. Please quote the tracking number in any communication. This e-mail simply acknowledges receipt of your submission. If the editors decide for editorial reasons that the paper is unsuitable for publication in '.$journal_info['title'].', you will be informed as soon as possible.


'; if($journal_info['journal_id']==9){//life research 期刊发送收到文章邮件 $tt1 .= 'Life Research applies the CC BY-NC 4.0 license. Full details of the policy can be found at https://www.tmrjournals.com/notice.html?J_num=14&footer_id=123. Authors should read Guide to Authors carefully before submitting.

'; @@ -990,7 +1025,7 @@ class Article extends Controller { */ public function getReviewerList() { $data = $this->request->post(); - $limit_start = $data['pageIndex'] == 1 ? 0 : ($data['pageIndex'] - 1) * $data['pageSize'] - 1; + $limit_start = ($data['pageIndex'] - 1) * $data['pageSize']; $where['t_article_reviewer.article_id'] = $data['articleId']; $res = $this->article_reviewer_obj->field('t_article_reviewer.*,t_user.email,t_user.account reviewer,t_user_reviewer_info.country country,t_user_reviewer_info.field,t_user_reviewer_info.company,t_reviewer_major.title major_title,t_reviewer_major.ctitle major_ctitle') ->join('t_user', 't_article_reviewer.reviewer_id = t_user.user_id', 'LEFT') diff --git a/application/api/controller/Auto.php b/application/api/controller/Auto.php index 73e167a..5d87928 100644 --- a/application/api/controller/Auto.php +++ b/application/api/controller/Auto.php @@ -40,6 +40,79 @@ class Auto extends Controller { $this->user_log_obj = Db::name('user_log'); $this->reviewer_info_obj = Db::name('user_reviewer_info'); } + + /** + * 推送邮件给审稿人提醒审稿人 + */ + public function pushEmailForReviewer(){ + //筛选数据 + $list = $this->article_reviewer_obj->where("state","in",[0,5])->select(); + foreach ($list as $v){ + $cache_article = $this->article_obj->where("article_id",$v['article_id'])->find(); + if($cache_article["state"]!=2){ + continue; + } + $cache_t = intval((time()-$v["ctime"])/86400); + if($cache_t==14||$cache_t==21||$cache_t==28){ + $cache_journal = $this->journal_obj->where("journal_id",$cache_article['journal_id'])->find(); + //查找审稿人信息 + $cache_reviewer = $this->user_obj + ->join("t_user_reviewer_info","t_user_reviewer_info.reviewer_id = t_user.user_id","left") + ->where("t_user.user_id",$v['reviewer_id'])->find(); + + $tt = "Manuscript ID: ".$cache_article['accept_sn']."
"; + $tt .= "Title:".$cache_article['title']."
"; + $tt .= "Dear ".($cache_reviewer['technical']==""||$cache_reviewer['technical']=="Others"?"Dr.":$cache_reviewer['technical'])." ".($cache_reviewer["realname"]==""?$cache_reviewer["account"]:$cache_reviewer["realname"])."

"; + $tt .= "On ".date("d D Y",$v["ctime"])." we sent you a request to review a paper title ".$cache_article['title'].".

"; + $tt .= "We have not yet received a response from you, possibly because the original invitation went astray. We would be grateful if you could let us know if you can carry out this review.

"; + $tt .= "If you would like to review this paper, please click this link.

"; + $tt .= "If you do not wish to review this paper, please click this link.

"; + $tt .= 'Sincerely,
Editorial Office
'.$cache_journal['title'].'
'; + $tt .= 'Email: '.$cache_journal['email'].'
'; + $tt .= 'Website:'.$cache_journal['website'].''; + + $maidata['email'] = $cache_reviewer['email']; + $maidata['title'] = "Invitation to review manuscript for ".$cache_journal['title']." - Reminder"; + $maidata['content'] = $tt; + $maidata['tmail'] = $cache_journal['email']; + $maidata['tpassword'] = $cache_journal['epassword']; + Queue::push('app\api\job\mail@fire', $maidata, "tmail"); + } + } + } + + /** + * 推送邮件提醒作者修回稿件 + */ + public function pushEmailForAuthor(){ + //筛选数据 + $list = $this->article_obj->where("state",4)->select(); + foreach ($list as $v){ + $cache_t = intval((time()-$v["ttime"])/86400); + if($cache_t==14||$cache_t==21||$cache_t==28){ + //查找文章内容 + $cache_journal = $this->journal_obj->where("journal_id",$v['journal_id'])->find(); + //查找作者信息 + $cache_author = $this->user_obj->where("user_id",$v['user_id'])->find(); + + $tt = "Dear Author,
"; + $tt .= "We have send you the email about revision of your manuscript. According to our records you are almost reaching the deadline now. We look forward to receiving your revised article.

"; + $tt .= "When preparing your revised manuscript, you are asked to carefully consider the reviewers' comments which are attached, and submit a revised versionand a list of responses to the comments before deadline. The revised parts in the manuscript should be highlighted with blue color.

"; + $tt .= "If you feel that you will require more time to complete your revision, please let me know and I will update our records accordingly. If I can provide any further advice or assistance, please do not hesitate to contact me.


"; + $tt .= 'Sincerely,
Editorial Office
'.$cache_journal['title'].'
'; + $tt .= 'Email: '.$cache_journal['email'].'
'; + $tt .= 'Website:'.$cache_journal['website'].''; + + $maidata['email'] = $cache_author['email']; + $maidata['title'] = "Deadline for your revision of ".$cache_journal['title']." -Reminder"; + $maidata['content'] = $tt; + $maidata['tmail'] = $cache_journal['email']; + $maidata['tpassword'] = $cache_journal['epassword']; + Queue::push('app\api\job\mail@fire', $maidata, "tmail"); + } + } + + } /** * 自动审稿主方法 diff --git a/application/api/controller/Chief.php b/application/api/controller/Chief.php index fbcbafd..1637968 100644 --- a/application/api/controller/Chief.php +++ b/application/api/controller/Chief.php @@ -718,7 +718,7 @@ class Chief extends Controller { //发送邮件给编委,并创造直连链接 $tt = $article_info['accept_sn'].'
'; - $tt .= 'Dear '.($board_rev_info==null||$board_rev_info['technical']=="Others"||$board_rev_info['technical']==""?"Dr.":$board_rev_info['technical']).($board_info['realname']==''?'':$board_info['realname']).',
'; + $tt .= 'Dear '.($board_rev_info==null||$board_rev_info['technical']=="Others"||$board_rev_info['technical']==""?"Dr.":$board_rev_info['technical']).($board_info['realname']==''?$board_info["account"]:$board_info['realname']).',
'; $tt .= 'The manuscript entitled “'.$article_info['title'].'”is under fininal decision status of the journal '.$journal_info['title'].'.
'; $tt .= '(The manuscripit in fininal decision status has been peer-reviewed, and the authors had revised all review opinions.)
'; $tt .= 'The Editor-in-Chief would be most grateful if you could offer an opinion regarding its suitability for publication in the journal '.$journal_info['title'].'.
'; diff --git a/application/api/controller/Major.php b/application/api/controller/Major.php new file mode 100644 index 0000000..5e0733e --- /dev/null +++ b/application/api/controller/Major.php @@ -0,0 +1,177 @@ +user_obj = Db::name('user'); + $this->user_act_obj = Db::name('user_act'); + $this->article_obj = Db::name('article'); + $this->journal_obj = Db::name('journal'); + $this->user_log_obj = Db::name('user_log'); + $this->user_reviewer_info_obj = Db::name("user_reviewer_info"); + $this->reviewer_major_obj = Db::name('reviewer_major'); + $this->reviewer_to_journal_obj = Db::name('reviewer_to_journal'); + $this->article_reviewer_question_obj = Db::name('article_reviewer_question'); + $this->article_msg_obj = Db::name('article_msg'); + $this->article_file_obj = Db::name('article_file'); + $this->article_reviewer_obj = Db::name('article_reviewer'); + $this->article_author_obj = Db::name('article_author'); + $this->article_transfer_obj = Db::name('article_transfer'); + $this->chief_to_journal_obj = Db::name('chief_to_journal'); + $this->login_auto_obj = Db::name('login_auto'); + $this->major_obj = Db::name("major"); + } + + /** + * @title 添加领域 + * @description 添加领域 + * @author wangjinlei + * @url /api/Major/addMajor + * @method POST + * + * @param name:major_title type:string require:1 desc:领域名 + * @param name:nickname type:string require:0 desc:别称 + * @param name:major_sort type:int require:0 desc:权重 + * @param name:pid type:int require:1 desc:父级id(0代表顶级) + * + */ + public function addMajor(){ + $data = $this->request->post(); + $insert['major_title'] = trim($data['major_title']); + $insert['pid'] = $data['pid']; + if(isset($data['nickname'])){ + $insert['nickname'] = trim($data['nickname']); + } + if(isset($data['major_sort'])){ + $insert['major_sort'] = $data['major_sort']; + } + if($data['pid']==0){ + $insert['major_level'] = 1; + }else{ + $p_major = $this->major_obj->where('major_id',$data['pid'])->find(); + $insert['major_level'] = $p_major['major_level']+1; + } + $insert['major_ctime'] = time(); + $this->major_obj->insert($insert); + return jsonSuccess([]); + } + + /** + * @title 编辑领域 + * @description 编辑领域 + * @author wangjinlei + * @url /api/Major/editMajor + * @method POST + * + * @param name:major_id type:int require:1 desc:领域id + * @param name:major_title type:string require:1 desc:领域名 + * @param name:nickname type:string require:0 desc:别称 + * @param name:major_sort type:int require:0 desc:权重 + * + */ + public function editMajor(){ + $data = $this->request->post(); + $update['major_title'] = trim($data['major_title']); + if(isset($data['nickname'])){ + $update['nickname'] = trim($data['nickname']); + } + if(isset($data['major_sort'])){ + $update['major_sort'] = $data['major_sort']; + } + $this->major_obj->where("major_id",$data['major_id'])->update($update); + return jsonSuccess([]); + } + + /** + * @title 获取领域树 + * @description 获取领域树 + * @author wangjinlei + * @url /api/Major/getMajorList + * @method POST + * + * @return majors:领域树 + */ + public function getMajorList(){ + //查询顶级 + $list = $this->major_obj->where('pid',0)->where('major_state',0)->order('major_sort desc')->select(); + foreach ($list as $k => $v){ + $cache_child = $this->getMajorChild($v); + if($cache_child!=null){ + $list[$k]['children'] = $cache_child; + } + } + + $re['majors'] = $list; + return jsonSuccess($re); + } + + /** + * @title 添加期刊领域 + * @description 添加期刊领域 + * @author wangjinlei + * @url /api/Major/addJournalMajor + * @method POST + * + * @param name:major_id type:int require:1 desc:领域id + * @param name:jou $name Description + * + * @return majors:领域树 + */ + public function addJournalMajor(){ + + } + + + /** + * 获取领域子树 + */ + private function getMajorChild($major){ + $list = $this->major_obj->where('pid',$major['major_id'])->where('major_state',0)->order("major_sort desc")->select(); + if($list == null){ + return null; + } + foreach ($list as $k => $v){ + $cache_child = $this->getMajorChild($v); + if($cache_child!=null){ + $list[$k]['children'] = $cache_child; + } + } + return $list; + } + +} diff --git a/application/api/controller/Reviewer.php b/application/api/controller/Reviewer.php index afce28c..e7126ad 100644 --- a/application/api/controller/Reviewer.php +++ b/application/api/controller/Reviewer.php @@ -68,7 +68,7 @@ class Reviewer extends Controller { $count = $this->article_reviewer_obj->where('t_article_reviewer.reviewer_id', $reviewer_info['user_id'])->count(); return json(['code' => 0, 'data' => $res, 'total' => $count]); } - + /** * @title 获取待审审稿实例列表 * @description 获取待审审稿实例列表 @@ -80,33 +80,34 @@ class Reviewer extends Controller { * * @return lists:数据列表# */ - public function getReviewerListPending(){ + public function getReviewerListPending() { $data = $this->request->post(); //获取审稿人基本信息 - $reviewer_info = $this->user_obj->where('user_id',$data['user_id'])->find(); + $reviewer_info = $this->user_obj->where('user_id', $data['user_id'])->find(); $res = $this->article_reviewer_obj->field('t_article_reviewer.*,t_article.title article_title,t_article.abstrart,t_article.major_id,t_article.cmajor_id,t_article.type,t_journal.title journal_title,t_article.accept_sn accept_sn') ->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') ->where('t_article_reviewer.reviewer_id', $reviewer_info['user_id']) - ->where('t_article_reviewer.state',0) + ->where("t_article.state",2) + ->where('t_article_reviewer.state', 0) ->select(); - foreach ($res as $k => $v){ - if($v['type']){ + foreach ($res as $k => $v) { + if ($v['type']) { $res[$k]['type'] = translateType($v['type']); } } //加上文章领域 - foreach($res as $k => $v){ - $major = $this->reviewer_major_obj->where('major_id',$v['major_id'])->find(); - $cmajor = $this->reviewer_major_obj->where('major_id',$v['cmajor_id'])->find(); + foreach ($res as $k => $v) { + $major = $this->reviewer_major_obj->where('major_id', $v['major_id'])->find(); + $cmajor = $this->reviewer_major_obj->where('major_id', $v['cmajor_id'])->find(); $res[$k]['major'] = $major['title']; $res[$k]['cmajor'] = $cmajor['title']; } - + $re['lists'] = $res; return jsonSuccess($re); } - + /** * @title 获取历史审稿实例列表 * @description 获取历史审稿实例列表 @@ -120,38 +121,38 @@ class Reviewer extends Controller { * * @return lists:数据列表# */ - public function getReviewerListHistory(){ + public function getReviewerListHistory() { $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.major_id,t_article.abstrart,t_article.cmajor_id,t_article.title article_title,t_article.type,t_journal.title journal_title,t_article.accept_sn accept_sn') + $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') ->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') ->where('t_article_reviewer.reviewer_id', $reviewer_info['user_id']) - ->where('t_article_reviewer.state','in',[1,2,3,4]) + ->where('t_article_reviewer.state', 'in', [1, 2, 3, 4]) ->order('t_article_reviewer.state') ->limit($limit_start, $data['pageSize']) ->select(); - foreach ($res as $k => $v){ - if($v['type']){ + foreach ($res as $k => $v) { + if ($v['type']) { $res[$k]['type'] = translateType($v['type']); } } - + //加上文章领域 - foreach($res as $k => $v){ - $major = $this->reviewer_major_obj->where('major_id',$v['major_id'])->find(); - $cmajor = $this->reviewer_major_obj->where('major_id',$v['cmajor_id'])->find(); + foreach ($res as $k => $v) { + $major = $this->reviewer_major_obj->where('major_id', $v['major_id'])->find(); + $cmajor = $this->reviewer_major_obj->where('major_id', $v['cmajor_id'])->find(); $res[$k]['major'] = $major['title']; $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->where('reviewer_id', $reviewer_info['user_id'])->where('state', 'in', [1, 2, 3, 4])->count(); $re['lists'] = $res; $re['count'] = $count; return jsonSuccess($re); } - + /** * @title 审稿实例详情----主动申请审稿实例详情 * @description 审稿实例详情----主动申请审稿实例详情 @@ -164,38 +165,38 @@ class Reviewer extends Controller { * * @return lists:数据列表# */ - public function getArtRevDetail(){ + public function getArtRevDetail() { $data = $this->request->post(); - $res = $this->article_reviewer_obj->where('reviewer_id',$data['user_id'])->where('article_id',$data['article_id'])->find(); - if($res!==null){ + $res = $this->article_reviewer_obj->where('reviewer_id', $data['user_id'])->where('article_id', $data['article_id'])->find(); + if ($res !== null) { return jsonError('Instance exists'); } $article = $this->article_obj ->field('t_article.*,t_journal.title journal_title') - ->join('t_journal','t_journal.journal_id = t_article.journal_id','left') - ->where('t_article.article_id',$data['article_id']) + ->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'left') + ->where('t_article.article_id', $data['article_id']) ->find(); $re['article'] = $article; return jsonSuccess($re); } - + /** * 获取审稿人详情 * */ - public function getReviewerDetail(){ + public function getReviewerDetail() { $uid = $this->request->post('rid'); //获取基本信息 - $base_info = $this->user_obj->join('t_user_reviewer_info','t_user.user_id = t_user_reviewer_info.reviewer_id')->where('t_user.user_id',$uid)->find(); + $base_info = $this->user_obj->join('t_user_reviewer_info', 't_user.user_id = t_user_reviewer_info.reviewer_id')->where('t_user.user_id', $uid)->find(); //增加major - $major_res = $this->reviewer_major_obj->where('major_id',$base_info['major'])->column('title'); - $base_info['major_title'] = $major_res?$major_res[0]:''; - $cmajor_res = $this->reviewer_major_obj->where('major_id',$base_info['cmajor'])->column('title'); - $base_info['cmajor_title'] = $cmajor_res?$cmajor_res[0]:''; - - return json(['data'=>$base_info]); + $major_res = $this->reviewer_major_obj->where('major_id', $base_info['major'])->column('title'); + $base_info['major_title'] = $major_res ? $major_res[0] : ''; + $cmajor_res = $this->reviewer_major_obj->where('major_id', $base_info['cmajor'])->column('title'); + $base_info['cmajor_title'] = $cmajor_res ? $cmajor_res[0] : ''; + + return json(['data' => $base_info]); } - + /** * @title 获取审稿人详情通过用户名或邮箱 * @description 获取审稿人详情通过用户名或邮箱 @@ -207,18 +208,18 @@ class Reviewer extends Controller { * * @return reviewer:审稿人详情信息# */ - public function getReviewerByNameEmail(){ + public function getReviewerByNameEmail() { $data = $this->request->post(); $check = $this->user_obj - ->join('t_user_reviewer_info','t_user_reviewer_info.reviewer_id = t_user.user_id','left') - ->where('t_user.account|t_user.email','like','%'.$data['account'].'%') - ->where('t_user.state',0) + ->join('t_user_reviewer_info', 't_user_reviewer_info.reviewer_id = t_user.user_id', 'left') + ->where('t_user.account|t_user.email', 'like', '%' . $data['account'] . '%') + ->where('t_user.state', 0) ->find(); $check['title'] = $check['technical']; $re['reviewer'] = $check; return jsonSuccess($re); } - + /** * @title 获取审稿人详情 * @description 获取审稿人详情 @@ -229,19 +230,19 @@ class Reviewer extends Controller { * @param name:user_id type:int require:1 desc:审稿人id * */ - public function getReviewerDetail1(){ + public function getReviewerDetail1() { $data = $this->request->post(); - + //获取基本信息 - $base_info = $this->user_obj->join('t_user_reviewer_info','t_user.user_id = t_user_reviewer_info.reviewer_id','left')->where('t_user.user_id',$data['user_id'])->find(); + $base_info = $this->user_obj->join('t_user_reviewer_info', 't_user.user_id = t_user_reviewer_info.reviewer_id', 'left')->where('t_user.user_id', $data['user_id'])->find(); //增加major - $major_res = $this->reviewer_major_obj->where('major_id',$base_info['major'])->column('title'); - $base_info['major_title'] = $major_res?$major_res[0]:''; - $cmajor_res = $this->reviewer_major_obj->where('major_id',$base_info['cmajor'])->column('title'); - $base_info['cmajor_title'] = $cmajor_res?$cmajor_res[0]:''; - - $journals = $this->reviewer_to_journal_obj->field('t_journal.*')->join('t_journal','t_reviewer_to_journal.journal_id = t_journal.journal_id','left')->where('t_reviewer_to_journal.reviewer_id',$data['user_id'])->where('t_reviewer_to_journal.state',0)->select(); - + $major_res = $this->reviewer_major_obj->where('major_id', $base_info['major'])->column('title'); + $base_info['major_title'] = $major_res ? $major_res[0] : ''; + $cmajor_res = $this->reviewer_major_obj->where('major_id', $base_info['cmajor'])->column('title'); + $base_info['cmajor_title'] = $cmajor_res ? $cmajor_res[0] : ''; + + $journals = $this->reviewer_to_journal_obj->field('t_journal.*')->join('t_journal', 't_reviewer_to_journal.journal_id = t_journal.journal_id', 'left')->where('t_reviewer_to_journal.reviewer_id', $data['user_id'])->where('t_reviewer_to_journal.state', 0)->select(); + //获取审稿人期刊与对应身份 // $frag = []; // $revs = $this->reviewer_to_journal_obj->join('t_journal','t_reviewer_to_journal.journal_id = t_journal.journal_id','left')->where('t_reviewer_to_journal.reviewer_id',$data['user_id'])->where('t_reviewer_to_journal.state',0)->select(); @@ -271,16 +272,16 @@ class Reviewer extends Controller { $re['reviewer'] = $base_info; return jsonSuccess($re); } - + /** * 更改审稿人信息 */ - public function editReviewer(){ + public function editReviewer() { $data = $this->request->post(); - $this->user_reviewer_info_obj->where('reviewer_info_id',$data['reviewer_info_id'])->update(['major'=>$data['major'],'cmajor'=>$data['cmajor']]); - return json(['code'=>0]); + $this->user_reviewer_info_obj->where('reviewer_info_id', $data['reviewer_info_id'])->update(['major' => $data['major'], 'cmajor' => $data['cmajor']]); + return json(['code' => 0]); } - + /** * @title 发起审稿 * @description 发起审稿 @@ -301,23 +302,23 @@ class Reviewer extends Controller { * @param name:introduction type:string require:0 desc:简介 * @param name:company type:string require:0 desc:单位 */ - public function editUserReviewer(){ + public function editUserReviewer() { $data = $this->request->post(); $update['email'] = trim($data['email']); - $update['realname'] = isset($data['realname'])?trim($data['realname']):''; - $update['orcid'] = isset($data['orcid'])?trim($data['orcid']):''; - $this->user_obj->where('user_id',$data['user_id'])->update($update); - + $update['realname'] = isset($data['realname']) ? trim($data['realname']) : ''; + $update['orcid'] = isset($data['orcid']) ? trim($data['orcid']) : ''; + $this->user_obj->where('user_id', $data['user_id'])->update($update); + $info_update['gender'] = $data['gender']; $info_update['technical'] = $data['title']; $info_update['country'] = $data['country']; - $info_update['introduction'] = isset($data['introduction'])?trim($data['introduction']):''; - $info_update['company'] = isset($data['company'])?trim($data['company']):''; + $info_update['introduction'] = isset($data['introduction']) ? trim($data['introduction']) : ''; + $info_update['company'] = isset($data['company']) ? trim($data['company']) : ''; $info_update['major'] = $data['major']; $info_update['cmajor'] = $data['cmajor']; $info_update['field'] = trim($data['field']); - $this->user_reviewer_info_obj->where('reviewer_id',$data['user_id'])->update($info_update); - + $this->user_reviewer_info_obj->where('reviewer_id', $data['user_id'])->update($info_update); + return jsonSuccess([]); } @@ -328,45 +329,45 @@ class Reviewer extends Controller { //接受参数,查询信息 $data = $this->request->post(); $artrev_info = $this->article_reviewer_obj->where('art_rev_id', $data['artrevid'])->find(); - $article_info = $this->article_obj->where('article_id',$artrev_info['article_id'])->find(); - $editor_info = $this->user_obj->where('user_id',$article_info['editor_id'])->find(); - $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find(); + $article_info = $this->article_obj->where('article_id', $artrev_info['article_id'])->find(); + $editor_info = $this->user_obj->where('user_id', $article_info['editor_id'])->find(); + $journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find(); if ($type == 'editor') { $up_data['editor_act'] = 1; - $user_msg_url = '/reviewerArticleDetail?id='.$data['artrevid']; + $user_msg_url = '/reviewerArticleDetail?id=' . $data['artrevid']; $user_info = $this->user_obj->where('account', $data['editor'])->find(); } else { $up_data['reviewer_act'] = 1; - $user_msg_url = '/articleReviewerDetail?id='.$data['artrevid']; + $user_msg_url = '/articleReviewerDetail?id=' . $data['artrevid']; $user_info = $this->user_obj->where('user_id', $artrev_info['reviewer_id'])->find(); } - + //上传 self::save_article_reviewer_file($data['artrevid'], $user_info['user_id'], $user_info['account'], $data['articlefile'], 'articlefile'); if ($data['articlezip'] != '') { self::save_article_reviewer_file($data['artrevid'], $user_info['user_id'], $user_info['account'], $data['articlezip'], 'articlezip'); } - + //更新实例状态 - $this->article_reviewer_obj->where('art_rev_id',$data['artrevid'])->update($up_data); - + $this->article_reviewer_obj->where('art_rev_id', $data['artrevid'])->update($up_data); + //记录userlog $log_data['user_id'] = $user_info['user_id']; $log_data['type'] = 3; $log_data['content'] = $user_info['account'] . "(" . $user_info['realname'] . "),更改了一篇文章审稿实例:(" . $article_info['title'] . ")的状态,更改时间是:" . date('Y-m-d H:i:s', time()); $log_data['ctime'] = time(); $this->user_log_obj->insert($log_data); - + //发送email提醒 if ($type != 'editor') { $tt = 'Dear editor,
'; $tt .= 'Please check the new comments from the reviewer.'; - 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']); } - + //保存usermsg - add_usermsg($type == 'editor'?$artrev_info['reviewer_id']:$article_info['editor_id'], 'New status of the manuscript', $user_msg_url); - + add_usermsg($type == 'editor' ? $artrev_info['reviewer_id'] : $journal_info['editor_id'], 'New status of the manuscript', $user_msg_url); + return json(['code' => 0]); } @@ -383,8 +384,7 @@ class Reviewer extends Controller { } return json($frag); } - - + /** * @title 获取文章文件manuscirpt * @description 获取文章文件manuscirpt @@ -395,13 +395,13 @@ class Reviewer extends Controller { * @param name:revid type:int require:1 desc:art_rev_id文章审稿实例id * */ - public function getAFilelistByID(){ + public function getAFilelistByID() { $rev_id = $this->request->post('revid'); - $article_rev_info = $this->article_reviewer_obj->where('art_rev_id',$rev_id)->find(); - $file_list = $this->article_file_obj->where('article_id',$article_rev_info['article_id'])->where('type_name','manuscirpt')->order('file_id desc')->limit(1)->select(); - return json(['data'=>$file_list]); + $article_rev_info = $this->article_reviewer_obj->where('art_rev_id', $rev_id)->find(); + $file_list = $this->article_file_obj->where('article_id', $article_rev_info['article_id'])->where('type_name', 'manuscirpt')->order('file_id desc')->limit(1)->select(); + return json(['data' => $file_list]); } - + /** * @title 获取文章文件picturesAndTables * @description 获取文章文件picturesAndTables @@ -412,14 +412,13 @@ class Reviewer extends Controller { * @param name:revid type:int require:1 desc:art_rev_id文章审稿实例id * */ - public function getBFilelistByID(){ + public function getBFilelistByID() { $rev_id = $this->request->post('revid'); - $article_rev_info = $this->article_reviewer_obj->where('art_rev_id',$rev_id)->find(); - $file_list = $this->article_file_obj->where('article_id',$article_rev_info['article_id'])->where('type_name','picturesAndTables')->order('file_id desc')->limit(1)->select(); - return json(['data'=>$file_list]); + $article_rev_info = $this->article_reviewer_obj->where('art_rev_id', $rev_id)->find(); + $file_list = $this->article_file_obj->where('article_id', $article_rev_info['article_id'])->where('type_name', 'picturesAndTables')->order('file_id desc')->limit(1)->select(); + return json(['data' => $file_list]); } - /** * @title 审稿人详情页--获取文章审稿实例详情(审稿人,编辑) * @description 审稿人详情页--获取文章审稿实例详情(审稿人,编辑) @@ -433,27 +432,27 @@ class Reviewer extends Controller { public function getartrevdate() { //接受参数 $data = $this->request->post(); - + //查询实例数据 $res = $this->article_reviewer_obj->field('t_journal.*,t_article_reviewer.*,t_article.abstrart,t_article.title article_title,t_article.type atype,t_article.state astate,t_article.accept_sn accept_sn,t_user.account account') ->join('t_article', 't_article.article_id = t_article_reviewer.article_id', 'LEFT') ->join('t_user', 't_user.user_id = t_article_reviewer.reviewer_id', 'LEFT') - ->join('t_journal','t_journal.journal_id = t_article.journal_id','left') + ->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'left') ->where('t_article_reviewer.art_rev_id', $data['revid']) ->find(); //文章类型转译 $res['atype'] = translateType($res['atype']); //更改实例状态(消息提醒) - if($data['human']=='editor'){ + if ($data['human'] == 'editor') { $up_data['reviewer_act'] = 0; - }else{ + } else { $up_data['editor_act'] = 0; } $this->article_reviewer_obj->where('art_rev_id', $data['revid'])->update($up_data); - + return json($res); } - + /** * @title 申请审稿实例 * @description 申请审稿实例 @@ -467,10 +466,13 @@ class Reviewer extends Controller { public function addArticleReviewer() { //接收参数,查询数据 $data = $this->request->post(); - + $article_info = $this->article_obj->where('article_id', $data['articleId'])->find(); - $reviewer_info = $this->user_obj->where('user_id', $data['uid'])->find(); - $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find(); + $reviewer_info = $this->user_obj + ->join("t_user_reviewer_info","t_user_reviewer_info.reviewer_id = t_user.user_id","left") + ->where('t_user.user_id', $data['uid']) + ->find(); + $journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find(); //增加信息到文章审稿表 $insert_data['reviewer_id'] = $data['uid']; @@ -478,29 +480,30 @@ class Reviewer extends Controller { $insert_data['editor_act'] = 1; $insert_data['ctime'] = time(); $res = $this->article_reviewer_obj->insertGetId($insert_data); - + //发送email提醒审稿员 -// $tt = $article_info['accept_sn'] . '
'; -// $tt .= 'Dear '.$reviewer_info['realname'].'

'; -// $tt .= 'The manuscript entitled “'.$article_info['title'].'” has' -// . ' been submitted to the journal '.$journal_info['title'].'. The Editor-in-Chief would' -// . ' be most grateful if you could offer an opinion regarding its suitability for publication' -// . ' in the journal '.$journal_info['title'].'.
'; -// $tt .= 'Please bring into our knowledge if there is any potential Conflict of Interest. If you agree to review this manuscript, we ask you to complete your review and submit it by submission system within 10 days of receipt of the manuscript.

'; -// $tt .= 'Thank you for your consideration.
Look forward for your reply.
'; -// $tt .= 'Click here to review the article
'; -// $tt .= 'Your username:'.$reviewer_info['account'].'

'; -// $tt .= 'Your original password:123456qwe , if you have reset the password, please login with the new one or click the "forgot password".
'; -// $tt .= 'Sincerely,
Editorial Office
'; -// $tt .= 'Subscribe to this journal
'; -// $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']); + $tt = $article_info['accept_sn'] . '
'; + $tt .= 'Dear ' . ( $reviewer_info['technical'] == "Others" || $reviewer_info['technical'] == "" ? "Dr." : $reviewer_info['technical']) . ($reviewer_info['realname'] == '' ? $reviewer_info["account"] : $reviewer_info['realname']) . '

'; + $tt .= 'The manuscript entitled “'.$article_info['title'].'” has' + . ' been submitted to the journal '.$journal_info['title'].'. The Editor-in-Chief would' + . ' be most grateful if you could offer an opinion regarding its suitability for publication' + . ' in the journal '.$journal_info['title'].'.
'; + $tt .= 'Please bring into our knowledge if there is any potential Conflict of Interest. If you agree to review this manuscript, we ask you to complete your review and submit it by submission system within 10 days of receipt of the manuscript.

'; + $tt .= 'Thank you for your consideration.
Look forward for your reply.
'; + $tt .= 'Click here to review the article
'; + $tt .= 'Your username:'.$reviewer_info['account'].'

'; + $tt .= 'Your original password:123456qwe , if you have reset the password, please login with the new one or click the "forgot password".
'; + $tt .= 'Sincerely,
Editorial Office
'; + $tt .= 'Subscribe to this journal
'; + $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']); + return jsonSuccess([]); } - + /** * @title 获取文章详情 * @description 获取文章详情 @@ -510,22 +513,22 @@ class Reviewer extends Controller { * * @param name:article_id type:int require:1 desc:文章id */ - public function getArticleDetail(){ + public function getArticleDetail() { $data = $this->request->post(); $info = $this->article_obj->field('t_article.*,t_journal.title journal_title') - ->join('t_journal','t_journal.journal_id = t_article.journal_id','left') - ->where('t_article.article_id',$data['article_id']) + ->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'left') + ->where('t_article.article_id', $data['article_id']) ->find(); - - $major = $this->reviewer_major_obj->where('major_id',$info['major_id'])->find(); - $cmajor = $this->reviewer_major_obj->where('major_id',$info['cmajor_id'])->find(); + + $major = $this->reviewer_major_obj->where('major_id', $info['major_id'])->find(); + $cmajor = $this->reviewer_major_obj->where('major_id', $info['cmajor_id'])->find(); $info['major'] = $major['title']; $info['cmajor'] = $cmajor['title']; - + $re['article'] = $info; return jsonSuccess($re); } - + /** * @title 提交问卷(审稿人) * @description 提交问卷(审稿人) @@ -567,7 +570,7 @@ class Reviewer extends Controller { public function questionSubmit() { //接受参数,查询基础数据 $data = $this->request->post(); - + // $data['rev_qu_id'] = 3; // $data['art_rev_id'] = 23; // $data['qu1'] = 1; @@ -597,11 +600,11 @@ class Reviewer extends Controller { // $data['other'] = 1; // $data['confident'] = 'contetn1'; // $data['comment'] = 'contetsdasd'; - - $art_rev_info = $this->article_reviewer_obj->where('art_rev_id',$data['art_rev_id'])->find(); - $article_info = $this->article_obj->where('article_id',$art_rev_info['article_id'])->find(); - $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find(); - $editor_info = $this->user_obj->where('user_id',$journal_info['editor_id'])->find(); + + $art_rev_info = $this->article_reviewer_obj->where('art_rev_id', $data['art_rev_id'])->find(); + $article_info = $this->article_obj->where('article_id', $art_rev_info['article_id'])->find(); + $journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find(); + $editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find(); //组合insert数据,存储 $insert_data['art_rev_id'] = $data['art_rev_id']; $insert_data['qu1'] = $data['qu1']; @@ -612,33 +615,33 @@ class Reviewer extends Controller { $insert_data['qu6'] = $data['qu6']; $insert_data['qu7'] = $data['qu7']; $insert_data['qu8'] = $data['qu8']; - $insert_data['qu9'] = $data['qu9']?1:0; + $insert_data['qu9'] = $data['qu9'] ? 1 : 0; $insert_data['qu9_contents'] = $data['qu9contents']; - $insert_data['qu10'] = $data['qu10']?1:0; + $insert_data['qu10'] = $data['qu10'] ? 1 : 0; $insert_data['qu10_contents'] = $data['qu10contents']; - $insert_data['qu11'] = $data['qu11']?1:0; + $insert_data['qu11'] = $data['qu11'] ? 1 : 0; $insert_data['qu11_contents'] = $data['qu11contents']; - $insert_data['qu12'] = $data['qu12']?1:0; + $insert_data['qu12'] = $data['qu12'] ? 1 : 0; $insert_data['qu12_contents'] = $data['qu12contents']; - $insert_data['qu13'] = $data['qu13']?1:0; + $insert_data['qu13'] = $data['qu13'] ? 1 : 0; $insert_data['qu13_contents'] = $data['qu13contents']; - $insert_data['qu14'] = $data['qu14']?1:0; + $insert_data['qu14'] = $data['qu14'] ? 1 : 0; $insert_data['qu14_contents'] = $data['qu14contents']; - $insert_data['qu15'] = $data['qu15']?1:0; + $insert_data['qu15'] = $data['qu15'] ? 1 : 0; $insert_data['qu15_contents'] = $data['qu15contents']; $insert_data['rated'] = $data['rated']; $insert_data['recommend'] = $data['recommend']; $insert_data['other'] = $data['other']; $insert_data['confidential'] = $data['confident']; $insert_data['comments'] = $data['comment']; - $insert_data['is_anonymous'] = isset($data['is_anonymous'])?$data['is_anonymous']:0; + $insert_data['is_anonymous'] = isset($data['is_anonymous']) ? $data['is_anonymous'] : 0; if ($data['rev_qu_id'] == '') {//新增 $insert_data['ctime'] = time(); $res = $this->article_reviewer_question_obj->insert($insert_data); } else {//更新 $res = $this->article_reviewer_question_obj->where('rev_qu_id', $data['rev_qu_id'])->update($insert_data); } - + //根据recommend问题,改变此实例的状态,并且更改act消息提醒状态 if ($data['recommend'] == 1) { $artrevstate = 3; @@ -647,32 +650,31 @@ class Reviewer extends Controller { } else { $artrevstate = 2; } - $this->article_reviewer_obj->where('art_rev_id', $data['art_rev_id'])->update(['state' => $artrevstate,'reviewer_act'=>1]); + $this->article_reviewer_obj->where('art_rev_id', $data['art_rev_id'])->update(['state' => $artrevstate, 'reviewer_act' => 1]); //文章是从初始状态到其他状态,增加审稿人成功审核次数 - if($art_rev_info['state']==0){ - $this->user_obj->where('user_id',$art_rev_info['reviewer_id'])->setInc('rs_num'); + if ($art_rev_info['state'] == 0) { + $this->user_obj->where('user_id', $art_rev_info['reviewer_id'])->setInc('rs_num'); } - + //记录log - //生成pdf文件 $reviewer_pdf = self::pdftest($journal_info['title']); - + //发送email->编辑 $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']); - + $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']); + //发送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'].'

'; + $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_pdf); + sendEmail($reviewer_info['email'], 'Your contribution is greatly appreciated', $journal_info['title'], $tt1, $journal_info['email'], $journal_info['epassword'], $reviewer_pdf); //记录usermsg - add_usermsg($journal_info['editor_id'], 'Feedback questionnaire be unloaded.', '/articleReviewerDetail?id='.$data['art_rev_id']); - + add_usermsg($journal_info['editor_id'], 'Feedback questionnaire be unloaded.', '/articleReviewerDetail?id=' . $data['art_rev_id']); + return json(['code' => 0]); } @@ -688,8 +690,7 @@ class Reviewer extends Controller { return json(['code' => 1]); } } - - + /** * 上传文章的文件 */ @@ -705,6 +706,31 @@ class Reviewer extends Controller { } } + + + /** + * @title 审稿人cv上传 + * @description 审稿人cv上传 + * @author wangjinlei + * @url /api/Reviewer/up_cv_file + * @method POST + * + * @param name:name type:string require:1 default:reviewerCV desc:文件域名称 + * + * @return upurl:图片地址 + */ + public function up_cv_file() { + $file = request()->file('reviewerCV'); + if ($file) { + $info = $file->move(ROOT_PATH . 'public' . DS . 'reviewer'); + if ($info) { + return json(['code' => 0, 'upurl' => str_replace("\\", "/", $info->getSaveName())]); + } else { + return json(['code' => 1, 'msg' => $file->getError()]); + } + } + } + /** * @title 待审文章页--获取待审文章列表 * @description 待审文章页--获取待审文章列表 @@ -720,41 +746,41 @@ class Reviewer extends Controller { * @return articles:文章列表# * @return count:总数# */ - public function getAllReviewerList(){ + public function getAllReviewerList() { $data = $this->request->post(); $limit_start = ($data['pageIndex'] - 1) * $data['pageSize']; - $artids = $this->article_reviewer_obj->where('reviewer_id',$data['user_id'])->column('article_id'); + $artids = $this->article_reviewer_obj->where('reviewer_id', $data['user_id'])->column('article_id'); $count = 0; - if($data['journal_id']==0){ - $journals = $this->reviewer_to_journal_obj->where('reviewer_id',$data['user_id'])->column('journal_id'); + if ($data['journal_id'] == 0) { + $journals = $this->reviewer_to_journal_obj->where('reviewer_id', $data['user_id'])->column('journal_id'); $arts = $this->article_obj ->field("t_article.*,t_article.major_id,t_article.abstrart,t_article.cmajor_id,t_journal.title journal_title") - ->join('t_journal','t_journal.journal_id = t_article.journal_id','left') - ->where('t_article.state',2) - ->where('t_article.article_id','not in',$artids) - ->where('t_article.journal_id','in',$journals) - ->limit($limit_start,$data['pageSize']) + ->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'left') + ->where('t_article.state', 2) + ->where('t_article.article_id', 'not in', $artids) + ->where('t_article.journal_id', 'in', $journals) + ->limit($limit_start, $data['pageSize']) ->select(); - $count = $this->article_obj->where('state',2)->where('article_id','not in',$artids)->where('journal_id','in',$journals)->count(); - }else{ + $count = $this->article_obj->where('state', 2)->where('article_id', 'not in', $artids)->where('journal_id', 'in', $journals)->count(); + } else { $arts = $this->article_obj - ->field("t_article.*,t_article.major_id,t_article.abstrart,t_article.cmajor_id,t_journal.title journal_title") - ->join('t_journal','t_journal.journal_id = t_article.journal_id','left') - ->where('t_article.journal_id',$data['journal_id']) - ->where('t_article.article_id','not in',$artids) - ->where('t_article.state',2) - ->limit($limit_start,$data['pageSize'])->select(); - $count = $this->article_obj->where('journal_id',$data['journal_id'])->where('article_id','not in',$artids)->where('state',2)->count(); + ->field("t_article.*,t_article.major_id,t_article.abstrart,t_article.cmajor_id,t_journal.title journal_title") + ->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'left') + ->where('t_article.journal_id', $data['journal_id']) + ->where('t_article.article_id', 'not in', $artids) + ->where('t_article.state', 2) + ->limit($limit_start, $data['pageSize'])->select(); + $count = $this->article_obj->where('journal_id', $data['journal_id'])->where('article_id', 'not in', $artids)->where('state', 2)->count(); } - foreach ($arts as $k => $v){ - if($v['type']){ + foreach ($arts as $k => $v) { + if ($v['type']) { $arts[$k]['type'] = translateType($v['type']); } } //加上文章领域 - foreach($arts as $k => $v){ - $major = $this->reviewer_major_obj->where('major_id',$v['major_id'])->find(); - $cmajor = $this->reviewer_major_obj->where('major_id',$v['cmajor_id'])->find(); + foreach ($arts as $k => $v) { + $major = $this->reviewer_major_obj->where('major_id', $v['major_id'])->find(); + $cmajor = $this->reviewer_major_obj->where('major_id', $v['cmajor_id'])->find(); $arts[$k]['major'] = $major['title']; $arts[$k]['cmajor'] = $cmajor['title']; } @@ -762,7 +788,7 @@ class Reviewer extends Controller { $re['count'] = $count; return jsonSuccess($re); } - + /** * @title 获取审稿人证书 * @description 获取审稿人证书 @@ -772,28 +798,28 @@ class Reviewer extends Controller { * * @param name:art_rev_id type:int require:1 desc:文章审稿实例id */ - public function getZSimg(){ + public function getZSimg() { $data = $this->request->post(); - $art_rev_info = $this->article_reviewer_obj->where('art_rev_id',$data['art_rev_id'])->find(); - $article_info = $this->article_obj->where('article_id',$art_rev_info['article_id'])->find(); + $art_rev_info = $this->article_reviewer_obj->where('art_rev_id', $data['art_rev_id'])->find(); + $article_info = $this->article_obj->where('article_id', $art_rev_info['article_id'])->find(); // if($article_info['rtime']==0){ // return jsonError('Certificate not issued'); // } - if(!file_exists(ROOT_PATH . 'public' . DS . 'reviewerZS' . DS . $data['art_rev_id'] . '.jpg')){ + if (!file_exists(ROOT_PATH . 'public' . DS . 'reviewerZS' . DS . $data['art_rev_id'] . '.jpg')) { $this->createZS($data['art_rev_id']); } $re['icon'] = 'reviewerZS' . DS . $data['art_rev_id'] . '.jpg'; return jsonSuccess($re); } - + /** * 创建证书方法 */ - private function createZS($art_rev_id){ - $art_rev_info = $this->article_reviewer_obj->where('art_rev_id',$art_rev_id)->find(); - $reviewer_info = $this->user_obj->where('user_id',$art_rev_info['reviewer_id'])->find(); - $article_info = $this->article_obj->where('article_id',$art_rev_info['article_id'])->find(); - $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find(); + private function createZS($art_rev_id) { + $art_rev_info = $this->article_reviewer_obj->where('art_rev_id', $art_rev_id)->find(); + $reviewer_info = $this->user_obj->where('user_id', $art_rev_info['reviewer_id'])->find(); + $article_info = $this->article_obj->where('article_id', $art_rev_info['article_id'])->find(); + $journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find(); // $url = 'http://journalapi.tmrjournals.com/public/index.php/master/Journal/getJournalIcon'; // $res = object_to_array(json_decode(myPost($url, ['issn'=>$journal_info['issn']]))); // $img = 'http://journalapi.tmrjournals.com/public/journalicon/'.$res['data']['icon']; @@ -802,15 +828,15 @@ class Reviewer extends Controller { $ziti = ROOT_PATH . 'public' . DS . 'zhengshu' . DS . 'siyuan.ttf'; $image = \think\Image::open($template); $image->text($journal_info['title'], $ziti, 70, '#000000', [1450, 950]) - ->text($reviewer_info['account'],$ziti, 60,'#000000', [1900,1700]) - ->text('awarded '.date('d, F, Y',$article_info['rtime']==0?$article_info['ctime']:$article_info['rtime']).' to',$ziti, 60,'#000000', [1600,1500]) - ->text('In recognitioin of the review made for the journal', $ziti, 80,'#000000',[900,1900]) - ->text('The Editors of', $ziti, 65, '#000000',[230,2345]) - ->text($journal_info['title'], $ziti, 60, '#000000', [910, 2345]) - ->text('Cockle Bay Rd, Auckland, New Zealand, 2014',$ziti, 60, '#000000',[230,2500]) - ->save(ROOT_PATH . 'public' . DS . 'reviewerZS' . DS . $art_rev_id.'.jpg'); + ->text($reviewer_info['account'], $ziti, 60, '#000000', [1900, 1700]) + ->text('awarded ' . date('d, F, Y', $article_info['rtime'] == 0 ? $article_info['ctime'] : $article_info['rtime']) . ' to', $ziti, 60, '#000000', [1600, 1500]) + ->text('In recognitioin of the review made for the journal', $ziti, 80, '#000000', [900, 1900]) + ->text('The Editors of', $ziti, 65, '#000000', [230, 2345]) + ->text($journal_info['title'], $ziti, 60, '#000000', [910, 2345]) + ->text('Cockle Bay Rd, Auckland, New Zealand, 2014', $ziti, 60, '#000000', [230, 2500]) + ->save(ROOT_PATH . 'public' . DS . 'reviewerZS' . DS . $art_rev_id . '.jpg'); } - + /** * @title 审稿人申请审稿 * @description 审稿人申请审稿 @@ -822,23 +848,23 @@ class Reviewer extends Controller { * @param name:user_id type:int require:1 desc:发起者userid * */ - public function launchReviewer(){ + public function launchReviewer() { $data = $this->request->post(); - - + + //审查是否重复发起 - $che = $this->article_reviewer_obj->where('article_id',$data['article_id'])->where('reviewer_id',$data['user_id'])->find(); - if($che!=null){ + $che = $this->article_reviewer_obj->where('article_id', $data['article_id'])->where('reviewer_id', $data['user_id'])->find(); + if ($che != null) { return jsonError('has review'); } //审查发起者是否具有审稿的权限 - $article_info = $this->article_obj->where('article_id',$data['article_id'])->find(); - $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find(); - $user_info = $this->user_obj->where('user_id',$data['user_id'])->find(); - $user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id",$user_info['user_id'])->find(); - $re_res = $this->reviewer_to_journal_obj->where('reviewer_id',$data['user_id'])->find(); - $bo_res = $this->board_to_journal_obj->where('user_id',$data['user_id'])->find(); - if($re_res==null&&$bo_res==null){ + $article_info = $this->article_obj->where('article_id', $data['article_id'])->find(); + $journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find(); + $user_info = $this->user_obj->where('user_id', $data['user_id'])->find(); + $user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id", $user_info['user_id'])->find(); + $re_res = $this->reviewer_to_journal_obj->where('reviewer_id', $data['user_id'])->find(); + $bo_res = $this->board_to_journal_obj->where('user_id', $data['user_id'])->find(); + if ($re_res == null && $bo_res == null) { return jsonError('No permission'); } //增加信息到文章审稿表 @@ -849,36 +875,36 @@ class Reviewer extends Controller { $res = $this->article_reviewer_obj->insertGetId($insert_data); //发送email提醒审稿员 $tt = $article_info['accept_sn'] . '
'; - $tt .= 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?'Authors':$user_info['realname']).'

'; - $tt .= 'The manuscript entitled “'.$article_info['title'].'” has' - . ' been submitted to the journal '.$journal_info['title'].'. The Editor-in-Chief would' + $tt .= 'Dear ' . ($user_rev_info == null || $user_rev_info['technical'] == "Others" || $user_rev_info['technical'] == "" ? "Dr." : $user_rev_info['technical']) . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . '

'; + $tt .= 'The manuscript entitled “' . $article_info['title'] . '” has' + . ' been submitted to the journal ' . $journal_info['title'] . '. The Editor-in-Chief would' . ' be most grateful if you could offer an opinion regarding its suitability for publication' - . ' in the journal '.$journal_info['title'].'.
'; + . ' in the journal ' . $journal_info['title'] . '.
'; $tt .= 'Please bring into our knowledge if there is any potential Conflict of Interest. If you agree to review this manuscript, we ask you to complete your review and submit it by submission system within 10 days of receipt of the manuscript.

'; $tt .= 'Thank you for your consideration.
Look forward for your reply.
'; - $tt .= 'Click here to review the article
'; - $tt .= 'Your username:'.$user_info['account'].'

'; + $tt .= 'Click here to review the article
'; + $tt .= 'Your username:' . $user_info['account'] . '

'; $tt .= 'Your original password:123456qwe , if you have reset the password, please login with the new one or click the "forgot password".
'; $tt .= 'Sincerely,
Editorial Office
'; - $tt .= 'Subscribe to this journal
'; - $tt .= $journal_info['title'].'
'; - $tt .= 'Email:'.$journal_info['email'].'
'; - $tt .= 'Website:'.$journal_info['website']; + $tt .= 'Subscribe to this journal
'; + $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']); - + return jsonSuccess([]); } - - private function creatLoginUrlForreviewer($user,$article_id){ - $code = md5(time().rand(1000,9999).'thinkphp'); + + private function creatLoginUrlForreviewer($user, $article_id) { + $code = md5(time() . rand(1000, 9999) . 'thinkphp'); $insert['user_id'] = $user['user_id']; $insert['code'] = $code; $insert['ctime'] = time(); $this->login_auto_obj->insert($insert); - $url = 'https://submission.tmrjournals.com/per_text?Art_id='.$article_id.'&act='.$code; + $url = 'https://submission.tmrjournals.com/per_text?Art_id=' . $article_id . '&act=' . $code; return $url; } - + /** * @title 审稿人同意审稿 * @description 审稿人同意审稿 @@ -888,13 +914,13 @@ class Reviewer extends Controller { * * @param name:art_rev_id type:int require:1 desc:文章审稿id */ - public function agreeReviewerArticle(){ + public function agreeReviewerArticle() { $data = $this->request->post(); - $this->article_reviewer_obj->where('art_rev_id',$data['art_rev_id'])->update(['state'=>0]); - + $this->article_reviewer_obj->where('art_rev_id', $data['art_rev_id'])->update(['state' => 0]); + return jsonSuccess([]); } - + /** * @title 审稿人拒绝审稿 * @description 审稿人拒绝审稿 @@ -904,13 +930,34 @@ class Reviewer extends Controller { * * @param name:art_rev_id type:int require:1 desc:文章审稿id */ - public function refuseReviewerArticle(){ + public function refuseReviewerArticle() { $data = $this->request->post(); - $this->article_reviewer_obj->where('art_rev_id',$data['art_rev_id'])->update(['state'=>4]); + $this->article_reviewer_obj->where('art_rev_id', $data['art_rev_id'])->update(['state' => 4]); + //记录审稿失败次数 + $art_rev_info = $this->article_reviewer_obj->where('art_rev_id', $data['art_rev_id'])->find(); + $this->user_obj->where("user_id",$art_rev_info["reviewer_id"])->setInc("rd_num"); + return jsonSuccess([]); } + /** + * 拒绝审稿get方法 + */ + public function refusereview($aid){ + $art_rev_info = $this->article_reviewer_obj->where('art_rev_id', $aid)->find(); + + if($art_rev_info==null){ + return "error"; + } + $this->article_reviewer_obj->where('art_rev_id', $aid)->update(['state' => 4]); + + //记录审稿失败次数 + $this->user_obj->where("user_id",$art_rev_info["reviewer_id"])->setInc("rd_num"); + + echo "You have declined the reviewing invitation."; + } + /** * @title 获取邀请审稿实例列表 * @description 获取邀请审稿实例列表 @@ -920,32 +967,32 @@ class Reviewer extends Controller { * * @param name:user_id type:int require:1 desc:审稿人id */ - public function getInvitatReviewList(){ + public function getInvitatReviewList() { $data = $this->request->post(); $res = $this->article_reviewer_obj ->field("t_article_reviewer.art_rev_id,t_article.*,t_journal.title journal_title") - ->join('t_article','t_article.article_id = t_article_reviewer.article_id','left') - ->join('t_journal','t_journal.journal_id = t_article.journal_id','left') - ->where('t_article_reviewer.reviewer_id',$data['user_id']) - ->where('t_article_reviewer.state',5) + ->join('t_article', 't_article.article_id = t_article_reviewer.article_id', 'left') + ->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'left') + ->where('t_article_reviewer.reviewer_id', $data['user_id']) + ->where('t_article_reviewer.state', 5) ->select(); - foreach ($res as $k => $v){ - if($v['type']){ + foreach ($res as $k => $v) { + if ($v['type']) { $res[$k]['type'] = translateType($v['type']); } } //加上文章领域 - foreach($res as $k => $v){ - $major = $this->reviewer_major_obj->where('major_id',$v['major_id'])->find(); - $cmajor = $this->reviewer_major_obj->where('major_id',$v['cmajor_id'])->find(); + foreach ($res as $k => $v) { + $major = $this->reviewer_major_obj->where('major_id', $v['major_id'])->find(); + $cmajor = $this->reviewer_major_obj->where('major_id', $v['cmajor_id'])->find(); $res[$k]['major'] = $major['title']; $res[$k]['cmajor'] = $cmajor['title']; } - + $re['articles'] = $res; return jsonSuccess($re); } - + /** * @title 审查用户是否有审稿的权限 * @description 审查用户是否有审稿的权限 @@ -956,16 +1003,16 @@ class Reviewer extends Controller { * @param name:article_id type:int require:1 desc:文章id * @param name:user_id type:int require:1 desc:发起者userid */ - public function checkUserForReviewer(){ + public function checkUserForReviewer() { $data = $this->request->post(); - $re_res = $this->article_reviewer_obj->where('reviewer_id',$data['user_id'])->where('article_id',$data['article_id'])->find(); - if($re_res != null){ + $re_res = $this->article_reviewer_obj->where('reviewer_id', $data['user_id'])->where('article_id', $data['article_id'])->find(); + if ($re_res != null) { return jsonSuccess([]); - }else{ + } else { return jsonError('No permission'); } } - + /** * @title 检测用户 * @description 检测用户 @@ -977,19 +1024,19 @@ class Reviewer extends Controller { * * @return has:no-has(无-有)# */ - public function checkUser(){ + public function checkUser() { $data = $this->request->post(); - $user_info = $this->user_obj->where('account|email',$data['account'])->find(); + $user_info = $this->user_obj->where('account|email', $data['account'])->find(); $has = ''; - if($user_info==null){ + if ($user_info == null) { $has = 'no'; - }else{ + } else { $has = 'has'; } $re['has'] = $has; return jsonSuccess($re); } - + /** * @title 获取专业领域 * @description 获取专业领域 @@ -1001,13 +1048,13 @@ class Reviewer extends Controller { * * @return majors:专业列表# */ - public function getMajor(){ + public function getMajor() { $data = $this->request->post(); - $majors = $this->reviewer_major_obj->where('pid',$data['pid'])->where('state',0)->select(); + $majors = $this->reviewer_major_obj->where('pid', $data['pid'])->where('state', 0)->select(); $re['majors'] = $majors; return jsonSuccess($re); } - + /** * @title 获取全部专业领域 * @description 获取全部专业领域 @@ -1017,16 +1064,16 @@ class Reviewer extends Controller { * * @return majors:专业列表# */ - public function getAllMajor(){ - $majors = $this->reviewer_major_obj->where('pid',0)->where('state',0)->select(); - foreach ($majors as $k => $v){ - $cmajors = $this->reviewer_major_obj->where('pid',$v['major_id'])->where('state',0)->select(); + public function getAllMajor() { + $majors = $this->reviewer_major_obj->where('pid', 0)->where('state', 0)->select(); + foreach ($majors as $k => $v) { + $cmajors = $this->reviewer_major_obj->where('pid', $v['major_id'])->where('state', 0)->select(); $majors[$k]['children'] = $cmajors; } $re['majors'] = $majors; return jsonSuccess($re); } - + /** * @title 添加reviewer * @description 添加reviewer @@ -1047,10 +1094,11 @@ class Reviewer extends Controller { * @param name:orcid type:string require:0 desc:orcid * @param name:introduction type:string require:0 desc:简介 * @param name:company type:string require:0 desc:单位 + * @param name:cv type:string require:1 desc:审稿人简历 */ - public function addReviewer(){ + public function addReviewer() { $data = $this->request->post(); - + // $data['account'] = "wjl"; // $data['cmajor'] = "36"; // $data['country'] = "China"; @@ -1060,19 +1108,19 @@ class Reviewer extends Controller { // $data['major'] = "3"; // $data['title'] = "Ph.D."; // $data['field'] = "123454"; - - $check = $this->user_obj->where('account',trim($data['account']))->whereOr('email',$data['email'])->find(); - if($check!=null){ - return jsonError($data['account'].' has register'); + + $check = $this->user_obj->where('account', trim($data['account']))->whereOr('email', $data['email'])->find(); + if ($check != null) { + return jsonError($data['account'] . ' has register'); } - $journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find(); + $journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find(); Db::startTrans(); //筛选数据,添加数据 $insert['account'] = trim($data['account']); $insert['password'] = md5('123456qwe'); $insert['email'] = trim($data['email']); - $insert['realname'] = isset($data['realname'])?trim($data['realname']):''; - $insert['orcid'] = isset($data['orcid'])?trim($data['orcid']):''; + $insert['realname'] = isset($data['realname']) ? trim($data['realname']) : ''; + $insert['orcid'] = isset($data['orcid']) ? trim($data['orcid']) : ''; $insert['ctime'] = time(); $insert['type'] = 1; $insert['is_reviewer'] = 1; @@ -1081,10 +1129,11 @@ class Reviewer extends Controller { $info_insert['gender'] = $data['gender']; $info_insert['technical'] = $data['title']; $info_insert['country'] = $data['country']; - $info_insert['introduction'] = isset($data['introduction'])?trim($data['introduction']):''; - $info_insert['company'] = isset($data['company'])?trim($data['company']):''; + $info_insert['introduction'] = isset($data['introduction']) ? trim($data['introduction']) : ''; + $info_insert['company'] = isset($data['company']) ? trim($data['company']) : ''; $info_insert['major'] = $data['major']; $info_insert['cmajor'] = $data['cmajor']; + $info_insert['qualifications'] = trim($data['cv']); $info_insert['field'] = trim($data['field']); $res1 = $this->user_reviewer_info_obj->insertGetId($info_insert); $to_insert['reviewer_id'] = $uid; @@ -1093,27 +1142,27 @@ class Reviewer extends Controller { $to_insert['journal_title'] = $journal_info['title']; $to_insert['ctime'] = time(); $res2 = $this->reviewer_to_journal_obj->insertGetId($to_insert); - - if($uid && $res1&&$res2){ + + if ($uid && $res1 && $res2) { Db::commit(); //发送邮件通知审稿人 - $content = "Please find your following username and original password. Editorial team thank you for your supprot.
"; - $content .= 'Submission System
'; - $content .= '

username:' . trim($data['account']) . '

'; - $content .= '

Original Password: 123456qwe

'; - $maidata['email'] = trim($data['email']); - $maidata['title'] = $journal_info['title']; - $maidata['content'] = $content; - $maidata['tmail'] = $journal_info['email']; - $maidata['tpassword'] = $journal_info['epassword']; - Queue::push( 'app\api\job\mail@fire' , $maidata , "tmail" ); +// $content = "Please find your following username and original password. Editorial team thank you for your supprot.
"; +// $content .= 'Submission System
'; +// $content .= '

username:' . trim($data['account']) . '

'; +// $content .= '

Original Password: 123456qwe

'; +// $maidata['email'] = trim($data['email']); +// $maidata['title'] = $journal_info['title']; +// $maidata['content'] = $content; +// $maidata['tmail'] = $journal_info['email']; +// $maidata['tpassword'] = $journal_info['epassword']; +// Queue::push('app\api\job\mail@fire', $maidata, "tmail"); return jsonSuccess([]); - }else{ + } else { Db::rollback(); return jsonError('add error!'); } } - + /** * @title 添加reviewer(已存在用户) * @description 添加reviewer(已存在用户) @@ -1131,41 +1180,73 @@ class Reviewer extends Controller { * @param name:field type:string require:1 desc:领域 * @param name:introduction type:string require:0 desc:简介 * @param name:company type:string require:0 desc:单位 + * @param name:cv type:string require:1 desc:审稿人简历 */ - public function addReviewerBee(){ + public function addReviewerBee() { $data = $this->request->post(); - $journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find(); - $user_info = $this->user_obj->where('user_id',$data['user_id'])->where('state',0)->find(); - $reviewer_info = $this->user_reviewer_info_obj->where('reviewer_id',$data['user_id'])->where('state',0)->find(); - $revtojou = $this->reviewer_to_journal_obj->where('reviewer_id',$data['user_id'])->where('journal_id',$data['journal_id'])->where('state',0)->find(); - if($revtojou != null){ + $journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find(); + $user_info = $this->user_obj->where('user_id', $data['user_id'])->where('state', 0)->find(); + $reviewer_info = $this->user_reviewer_info_obj->where('reviewer_id', $data['user_id'])->where('state', 0)->find(); + $revtojou = $this->reviewer_to_journal_obj->where('reviewer_id', $data['user_id'])->where('journal_id', $data['journal_id'])->where('state', 0)->find(); + if ($revtojou != null) { return jsonError('has reviewer!!'); } $info_insert['reviewer_id'] = $data['user_id']; $info_insert['gender'] = $data['gender']; $info_insert['technical'] = $data['title']; $info_insert['country'] = $data['country']; - $info_insert['introduction'] = isset($data['introduction'])?trim($data['introduction']):''; - $info_insert['company'] = isset($data['company'])?trim($data['company']):''; + $info_insert['introduction'] = isset($data['introduction']) ? trim($data['introduction']) : ''; + $info_insert['company'] = isset($data['company']) ? trim($data['company']) : ''; $info_insert['major'] = $data['major']; $info_insert['cmajor'] = $data['cmajor']; $info_insert['field'] = trim($data['field']); - if($reviewer_info!=null){ + $info_insert['qualifications'] = trim($data['cv']); + if ($reviewer_info != null) { $this->user_reviewer_info_obj->insertGetId($info_insert); - }else{ - $this->user_reviewer_info_obj->where('reviewer_info_id',$reviewer_info['reviewer_info_id'])->update($info_insert); + } else { + $this->user_reviewer_info_obj->where('reviewer_info_id', $reviewer_info['reviewer_info_id'])->update($info_insert); } - + $to_insert['reviewer_id'] = $data['user_id']; $to_insert['journal_id'] = $data['journal_id']; $to_insert['account'] = $user_info['account']; $to_insert['journal_title'] = $journal_info['title']; $to_insert['ctime'] = time(); $this->reviewer_to_journal_obj->insertGetId($to_insert); - + return jsonSuccess([]); } + /** + * @title 编辑审稿人信息(编辑) + * @description 编辑审稿人信息(编辑) + * @author wangjinlei + * @url /api/Reviewer/editReviewerForEditor + * @method POST + * + * @param name:user_id type:int require:1 desc:用户id + * @param name:title type:string require:1 desc:用户title + * @param name:major type:int require:1 desc:领域 + * @param name:cmajor type:int require:1 desc:子领域 + * @param name:field type:string require:1 desc:领域 + * @param name:introduction type:string require:0 desc:简介 + * @param name:company type:string require:0 desc:单位 + * @param name:cv type:string require:1 desc:审稿人简历 + */ + public function editReviewerForEditor(){ + $data = $this->request->post(); +// $info_insert['reviewer_id'] = $data['user_id']; + $info_insert['technical'] = $data['title']; + $info_insert['introduction'] = isset($data['introduction']) ? trim($data['introduction']) : ''; + $info_insert['company'] = isset($data['company']) ? trim($data['company']) : ''; + $info_insert['major'] = $data['major']; + $info_insert['cmajor'] = $data['cmajor']; + $info_insert['field'] = trim($data['field']); + $info_insert['qualifications'] = trim($data['cv']); + $this->user_reviewer_info_obj->where("reviewer_id",$data['user_id'])->update($info_insert); + return jsonSuccess([]); + } + /** * @title 获取审稿人列表 * @description 获取审稿人列表 @@ -1180,27 +1261,27 @@ class Reviewer extends Controller { */ public function getReviewerListByJournal() { $data = $this->request->post(); - $editor_info = $this->user_obj->where('account',$data['username'])->where('state',0)->find(); + $editor_info = $this->user_obj->where('account', $data['username'])->where('state', 0)->find(); $limit_start = ($data['pageIndex'] - 1) * $data['pageSize']; $jous = []; - if($data['journalId'] == 0){ - $jous = $this->journal_obj->where('editor_id',$editor_info['user_id'])->where('state',0)->column('journal_id'); - }else{ + if ($data['journalId'] == 0) { + $jous = $this->journal_obj->where('editor_id', $editor_info['user_id'])->where('state', 0)->column('journal_id'); + } else { $jous[] = $data['journalId']; } $res = $this->reviewer_to_journal_obj ->field('t_reviewer_to_journal.is_yboard,t_user.*,t_user_reviewer_info.*,t_journal.title journal_title') - ->join('t_journal','t_journal.journal_id = t_reviewer_to_journal.journal_id','left') - ->join('t_user','t_user.user_id = t_reviewer_to_journal.reviewer_id','left') + ->join('t_journal', 't_journal.journal_id = t_reviewer_to_journal.journal_id', 'left') + ->join('t_user', 't_user.user_id = t_reviewer_to_journal.reviewer_id', 'left') ->join('t_user_reviewer_info', 't_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id', 'LEFT') - ->where('t_reviewer_to_journal.journal_id','in',$jous) - ->where('t_reviewer_to_journal.state',0) - ->limit($limit_start,$data['pageSize']) + ->where('t_reviewer_to_journal.journal_id', 'in', $jous) + ->where('t_reviewer_to_journal.state', 0) + ->limit($limit_start, $data['pageSize']) ->select(); - $count = $this->reviewer_to_journal_obj->where('t_reviewer_to_journal.journal_id','in',$jous)->where('t_reviewer_to_journal.state',0)->count(); + $count = $this->reviewer_to_journal_obj->where('t_reviewer_to_journal.journal_id', 'in', $jous)->where('t_reviewer_to_journal.state', 0)->count(); return json(['code' => 0, 'data' => $res, 'total' => $count]); } - + /** * @title 获取国家 * @description 获取国家 @@ -1215,7 +1296,174 @@ class Reviewer extends Controller { $re['countrys'] = $res; return json($re); } - + + /** + * @title 获取期刊审稿人范围内全部领域 + * @description 获取期刊审稿人范围内全部领域 + * @author wangjinlei + * @url /api/Reviewer/getAllReviewerMajor + * @method POST + * + * @param name:article_id type:int require:1 desc:文章id + * + * @return majors:领域列表# + */ + public function getAllReviewerMajor() { + $data = $this->request->post(); + $article_info = $this->article_obj->where("article_id", $data['article_id'])->find(); + + $ids = $this->reviewer_to_journal_obj + ->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left") + ->where('t_reviewer_to_journal.journal_id', $article_info['journal_id']) + ->where("t_reviewer_to_journal.state", 0) + ->column("t_user_reviewer_info.major"); + + $list = $this->reviewer_major_obj->where("major_id", "in",$ids)->where("state", 0)->select(); + foreach ($list as $k => $v) { + $list[$k]["children"] = $this->reviewer_major_obj->where("pid", $v["major_id"])->where("state", 0)->select(); + } + $re['majors'] = $list; + return jsonSuccess($re); + } + + /** + * @title 查找条件下的审稿人 + * @description 查找条件下的审稿人 + * @author wangjinlei + * @url /api/Reviewer/searchReviewer + * @method POST + * + * @param name:article_id type:int require:1 desc:文章id + * @param name:major_id type:int require:1 desc:领域id + * @param name:keywords type:string require:1 desc:关键词 + * @param name:pageIndex type:int require:1 desc:当前页码数 + * @param name:pageSize type:int require:1 desc:单页数据条数 + * + * @return reviewers:审稿人列表# + */ + public function searchReviewer() { + $data = $this->request->post(); + $article_info = $this->article_obj->where("article_id", $data['article_id'])->find(); + $noids = $this->article_reviewer_obj->where('article_id', $data['article_id'])->column('reviewer_id'); + $limit_start = ($data['pageIndex'] - 1) * $data['pageSize']; + $list = []; + $count = 0; + if ($data["keywords"] == "") { + if ($data["major_id"] == 0) { + $list = $this->reviewer_to_journal_obj + ->field("t_user.user_id,t_user.realname,t_reviewer_major.title cmajor,t_user.account,t_user_reviewer_info.company,t_user_reviewer_info.field,t_user.rs_num,t_user.rd_num") + ->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left") + ->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left") + ->join("t_reviewer_major","t_reviewer_major.major_id = t_user_reviewer_info.cmajor","left") + ->where('t_reviewer_to_journal.journal_id', $article_info['journal_id']) + ->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids) + ->where('t_reviewer_to_journal.state', 0) + ->order("t_user.rs_num desc") + ->limit($limit_start, $data['pageSize']) + ->select(); + $count = $this->reviewer_to_journal_obj + ->where('t_reviewer_to_journal.journal_id', $article_info['journal_id']) + ->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids) + ->where('t_reviewer_to_journal.state', 0) + ->count(); + } else { + $list = $this->reviewer_to_journal_obj + ->field("t_user.user_id,t_user.realname,t_reviewer_major.title cmajor,t_user.account,t_user_reviewer_info.company,t_user_reviewer_info.field,t_user.rs_num,t_user.rd_num") + ->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left") + ->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left") + ->join("t_reviewer_major","t_reviewer_major.major_id = t_user_reviewer_info.cmajor","left") + ->where('t_reviewer_to_journal.journal_id', $article_info['journal_id']) + ->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids) + ->where("t_user_reviewer_info.major", $data['major_id']) + ->where('t_reviewer_to_journal.state', 0) + ->order("t_user.rs_num desc") + ->limit($limit_start, $data['pageSize']) + ->select(); + $count = $this->reviewer_to_journal_obj + ->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left") + ->where('t_reviewer_to_journal.journal_id', $article_info['journal_id']) + ->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids) + ->where("t_user_reviewer_info.major", $data['major_id']) + ->where('t_reviewer_to_journal.state', 0) + ->count(); + } + } else { + if ($data["major_id"] == 0) { + $list = $this->reviewer_to_journal_obj + ->field("t_user.user_id,t_user.realname,t_reviewer_major.title cmajor,t_user.account,t_user_reviewer_info.company,t_user_reviewer_info.field,t_user.rs_num,t_user.rd_num") + ->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left") + ->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left") + ->join("t_reviewer_major","t_reviewer_major.major_id = t_user_reviewer_info.cmajor","left") + ->where('t_reviewer_to_journal.journal_id', $article_info['journal_id']) + ->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids) + ->where("t_user_reviewer_info.introduction|t_user_reviewer_info.field|t_user.account", "like", "%" . $data["keywords"] . "%") + ->where('t_reviewer_to_journal.state', 0) + ->order("t_user.rs_num desc") + ->limit($limit_start, $data['pageSize']) + ->select(); + $count = $this->reviewer_to_journal_obj + ->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left") + ->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left") + ->where('t_reviewer_to_journal.journal_id', $article_info['journal_id']) + ->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids) + ->where("t_user_reviewer_info.introduction|t_user_reviewer_info.field|t_user.account", "like", "%" . $data["keywords"] . "%") + ->where('t_reviewer_to_journal.state', 0) + ->count(); + } else { + $list = $this->reviewer_to_journal_obj + ->field("t_user.user_id,t_user.realname,t_reviewer_major.title cmajor,t_user.account,t_user_reviewer_info.company,t_user_reviewer_info.field,t_user.rs_num,t_user.rd_num") + ->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left") + ->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left") + ->join("t_reviewer_major","t_reviewer_major.major_id = t_user_reviewer_info.cmajor","left") + ->where('t_reviewer_to_journal.journal_id', $article_info['journal_id']) + ->where("t_user_reviewer_info.major", $data['major_id']) + ->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids) + ->where("t_user_reviewer_info.introduction|t_user_reviewer_info.field|t_user.account", "like", "%" . $data["keywords"] . "%") + ->where('t_reviewer_to_journal.state', 0) + ->order("t_user.rs_num desc") + ->limit($limit_start, $data['pageSize']) + ->select(); + $count = $this->reviewer_to_journal_obj + ->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left") + ->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left") + ->where('t_reviewer_to_journal.journal_id', $article_info['journal_id']) + ->where("t_user_reviewer_info.major", $data['major_id']) + ->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids) + ->where("t_user_reviewer_info.introduction|t_user_reviewer_info.field|t_user.account", "like", "%" . $data["keywords"] . "%") + ->where('t_reviewer_to_journal.state', 0) + ->count(); + } + } + $re['reviewers'] = $list; + $re['count'] = $count; + return jsonSuccess($re); + } + + /** + * @title 获取所有审稿意见 + * @description 获取所有审稿意见 + * @author wangjinlei + * @url /api/Reviewer/getAllReviewerObj + * @method POST + * + * @param name:article_id type:int require:1 desc:文章id + * + * @return reviews:审稿列表# + */ + public function getAllReviewerObj() { + $data = $this->request->post(); + $list = $this->article_reviewer_obj + ->where("article_id",$data['article_id']) + ->where("state","in",[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(); + } + + $re["reviews"] = $list; + return jsonSuccess($re); + } + /** * 存储reviewer文件历史信息 */ @@ -1233,12 +1481,11 @@ class Reviewer extends Controller { $insert_data['ctime'] = time(); return $this->article_reviewer_file_obj->insert($insert_data); } - - - public function pdft(){ + + public function pdft() { $this->pdftest('I am wjl'); } - + /** * 生成pdf感谢reviewer */ @@ -1262,13 +1509,13 @@ class Reviewer extends Controller { $pdf->SetFont('times', '', 14, '', true); $pdf->AddPage(); $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal')); - $html ='

To whom it may concern

' - . 'You have reviewed 1 submission in the journal '.$title.' during '.date('Y').' + $html = '

To whom it may concern

' + . 'You have reviewed 1 submission in the journal ' . $title . ' during ' . date('Y') . ' Thank you for your support to our journal. This contribution is greatly appreciated.' - .'

Regards
+ . '

Regards
Editorial Office
-'.$title.'

' - .'

Contact us

+' . $title . '

' + . '

Contact us

TMR Publishing Group Address: 11 Cockle Bay Rd, Cockle Bay, Auckland 2014, New Zealand
Telephone: +64 02108293806
E-mail: publisher@tmrjournals.com

'; @@ -1276,7 +1523,7 @@ E-mail: publisher@tmrjournals.com

'; $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true); // $pdf->Output('example_001.pdf', 'D'); // $pdf_wj = 'd:/example_001.pdf'; - $pdf_wj = $_SERVER['DOCUMENT_ROOT'].'public/pdf/'.date('YmdHis').'thanks.pdf'; + $pdf_wj = $_SERVER['DOCUMENT_ROOT'] . 'public/pdf/' . date('YmdHis') . 'thanks.pdf'; // $pdf_wj = '/public/pdf/'.date('YMD').'/'.date('His').'thanks.pdf'; $pdf->Output($pdf_wj, 'F'); return $pdf_wj; diff --git a/application/api/controller/Super.php b/application/api/controller/Super.php index 86a8e76..48cb6ce 100644 --- a/application/api/controller/Super.php +++ b/application/api/controller/Super.php @@ -53,6 +53,7 @@ class Super extends Controller{ $list[$k]['CC'] = $this->getCC($v['journal_id'],$start_time,$end_time); $list[$k]['WS'] = $this->getWS($v['journal_id'],$start_time,$end_time); $list[$k]['SJ'] = $this->getSJ($v['journal_id'],$start_time,$end_time); + $list[$k]['JST'] = $this->getJST($v['journal_id'],$start_time,$end_time); } return json($list); } @@ -131,6 +132,28 @@ class Super extends Controller{ return $all==0?0:$js/$all; } + private function getJST($journal_id,$start_time,$end_time){ + $list = $this->article_obj->where("journal_id",$journal_id) + ->where('rtime','>',$start_time) + ->where('rtime','<=',$end_time) + ->select(); + $f = 0; + foreach ($list as $v){ + $f += ($v['rtime']-$v["ctime"]); + } + $list1 = $this->article_obj->where("journal_id",$journal_id) + ->where('rstime','>',$start_time) + ->where('rstime','<=',$end_time) + ->select(); + foreach ($list1 as $v){ + $f += ($v['rstime']-$v["ctime"]); + } + + + $frag = count($list)==0?0:intval(($f/(count($list) + count($list1)))/(24*60*60)); + return $frag; + } + /** * 获取查重异常 */ diff --git a/application/api/controller/User.php b/application/api/controller/User.php index 2fcc457..ce34a6b 100644 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -58,7 +58,6 @@ class User extends Controller { */ public function checkLogin() { $data = $this->request->post(); - if($data['username']=='fariba'||$data['username']=='Mohammad Hossein'||$data['username']=='xiaoyueyue'||$data['username']=='sethlee000'||$data['username']=='yuanying9908'){ return json(['code'=>1,'msg'=>'Your account has been blocked. Please contact the publisher for details: publisher@tmrjournals.com.']); } @@ -292,7 +291,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); } @@ -371,7 +370,7 @@ class User extends Controller { $url = config('base_web_url') . 'retrieveact?actkey=' . $act_insert['act_key']; $title = 'Your request to reset your password [TMR Publishing Group]'; $content = "$realname, we've received your request to reset your password.Please click the link below to change your password. $url"; - $res = sendEmail($email, $title, 'TMR', $content); + $res = sendEmail($email, $title, 'TMR', $content,); if ($res['status'] == 1) {//成功 return json(['code' => 0, 'msg' => 'success']); } else {//失败