From e00dd3913b11367f94c3d17295f300b48bdd15bc Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Tue, 21 Dec 2021 16:54:13 +0800 Subject: [PATCH] 20201112 --- application/api/controller/Admin.php | 23 +- application/api/controller/Article.php | 166 +++++++--- application/api/controller/Board.php | 43 ++- application/api/controller/Chief.php | 77 ++++- application/api/controller/Reviewer.php | 421 ++++++++++++++++++++++-- application/api/controller/Staff.php | 105 +++++- application/api/controller/User.php | 36 +- application/common.php | 13 + 8 files changed, 785 insertions(+), 99 deletions(-) diff --git a/application/api/controller/Admin.php b/application/api/controller/Admin.php index 7a3e9ec..863f55c 100644 --- a/application/api/controller/Admin.php +++ b/application/api/controller/Admin.php @@ -373,8 +373,8 @@ class Admin extends Controller { continue; } //验证是否存在此用户并且存在对应关系 - $this_reviewer = self::get_username($v['username']); - $mme = self::get_userByEmail($v['email']); + $this_reviewer = self::get_username(trim($v['username'])); + $mme = self::get_userByEmail(trim($v['email'])); if ($this_reviewer == null && $mme != null) { $er_data[] = [ 'username' => trim($v['username']), @@ -409,7 +409,7 @@ class Admin extends Controller { //添加user主体基本信息 $cache_reviewer['account'] = trim($v['username']); $cache_reviewer['password'] = md5('123456qwe'); - $cache_reviewer['email'] = $v['email']; + $cache_reviewer['email'] = trim($v['email']); $cache_reviewer['realname'] = trim($v['realname']); $cache_reviewer['is_reviewer'] = 1; $cache_reviewer['ctime'] = time(); @@ -454,19 +454,10 @@ class Admin extends Controller { ]; //发送邮件提醒审稿人 -// $tt = 'Dear Reviewer,
'; -// $tt .= 'In order to provide a better online experience for both authors and readers, the submission system was changed to new.
'; -// $tt .= 'Website was closed between 18:00 Aug. 2, 2020 to 24:00 Aug. 2, 2020 Beijing time.
'; -// $tt .= 'You could log in with your account in submission.tmrjournals.com .
'; -// $tt .= 'Your username:'.$v['username'].'
'; -// $tt .= 'Your password: 123456qwe (you could change your password in the system by yourself later.)
'; -// $tt .= 'Thank you so much for your kindly support.

'; -// $tt .= $journal_info['title'].'
'; -// $tt .= date('Y-m-d'); - $content = "Thank you for registering as a " . $journal_info['title'] . " reviewer
". "At present, you have passed our examination
"; - $content .= 'Submission System
'; - $content .= '

username:' . trim($v['username']) . '

'; - $content .= '

Original Password: 123456qwe

';//$has_res ? '' : '

password:123456qwe

'; + $content = "Thank you for registering as a " . $journal_info['title'] . " reviewer
". "At present, you have passed our examination
"; + $content .= 'Submission System
'; + $content .= '

username:' . trim($v['username']) . '

'; + $content .= '

Original Password: 123456qwe

';//$has_res ? '' : '

password:123456qwe

'; $maidata['email'] = $v['email']; $maidata['title'] = $journal_info['title']; diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index af153fd..68eb20f 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -12,6 +12,7 @@ class Article extends Controller { protected $user_act_obj = ''; protected $journal_obj = ''; protected $user_log_obj = ''; + protected $user_reviewer_info_obj = ''; protected $reviewer_major_obj = ''; protected $reviewer_to_journal_obj = ''; protected $article_reviewer_question_obj = ''; @@ -30,6 +31,7 @@ class Article extends Controller { $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'); @@ -370,8 +372,9 @@ class Article extends Controller { $this->article_obj->where('article_id',$data['articleId'])->update(['author_act'=>1]); //发送邮件通知编辑 - $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(); + $editor_info = $this->user_obj->where('user_id',$journal_info['editor_id'])->find(); +// $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find(); $tt = 'Dear editor,
'; $tt .= 'The author changed the manuscript’s information, please check.'; sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt,$journal_info['email'],$journal_info['epassword']); @@ -395,6 +398,7 @@ class Article extends Controller { $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find(); $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信息 // // //接受文章时,生成流水号 @@ -423,14 +427,15 @@ class Article extends Controller { $insert_data['state_to'] = 1; $insert_data['ctime'] = time(); $this->article_msg_obj->insert($insert_data); - + $user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id",$user_info['user_id'])->find(); //发送邮件提醒转投给作者 $tt = '"'.$article_info['title'].'"
'; $tt .= $article_info['accept_sn'].'
'; $tt .= 'journal:'.$journal_info['title'].'
'; - $tt .= 'Dear '.($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']==''?'Authors':$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. I am writing just to follow up on the suggestion from the editor of Traditional Medicine Research that you might be interested in submitting your paper to '.$tran_journal['title'].' instead.

Yours sincerely,

'; + $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
'; $tt .= $journal_info['title'].'
'; $tt .= 'Subscribe to this journal
'; @@ -468,10 +473,11 @@ class Article extends Controller { //发送文章状态更改邮件 if($data['state']==3){//拒稿 if($data['trsjournal']==0){ + $tt = '"'.$article_info['title'].'"
'; $tt .= $article_info['accept_sn'].'
'; $tt .= 'journal:'.$journal_info['title'].'
'; - $tt .= 'Dear '.($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']==''?'Authors':$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. ' @@ -480,15 +486,24 @@ class Article extends Controller { }else{//转投 //查找转投journal信息 $trans_journal = $this->journal_obj->where('journal_id',$data['trsjournal'])->find(); - $tt = '"'.$article_info['title'].'"
'; - $tt .= $article_info['accept_sn'].'
'; - $tt .= 'journal:'.$journal_info['title'].'
'; - $tt .= 'Dear '.($user_info['realname']==''?'Authors':$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. I am writing just to follow up on the suggestion from the editor of Traditional Medicine Research that you might be interested in submitting your paper to '.$trans_journal['title'].' instead.

'; - $tt .= 'If you choose to pursue publication in '.$trans_journal['title'].', please click the folowing link to comfirm ('.$trans_journal['website'].').'; - $tt .= '

Yours sincerely,

'; - $tt .= 'Sincerely,
Editorial Office
'; +// $tt = '"'.$article_info['title'].'"
'; +// $tt .= $article_info['accept_sn'].'
'; +// $tt .= 'journal:'.$journal_info['title'].'
'; +// $tt .= 'Dear '.($user_info['realname']==''?'Authors':$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. I am writing just to follow up on the suggestion from the editor of Traditional Medicine Research that you might be interested in submitting your paper to '.$trans_journal['title'].' instead.

'; +// $tt .= 'If you choose to pursue publication in '.$trans_journal['title'].', please click the folowing link to comfirm ('.$trans_journal['website'].').'; +// $tt .= '

Yours sincerely,

'; +// $tt .= 'Sincerely,
Editorial Office
'; + + $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 very much for submitting your manuscript "'.$article_info['title'].'" ('.$article_info['accept_sn'].'). We had read your paper discussed it with our editorial team. Unfortunately, our opinion is that the paper would not be a strong candidate for '.$journal_info['title'].'. When a paper is turned down on editorial grounds, we aim to return it to the authors as quickly as possible, avoiding a time-consuming peer-review process.

'; + $tt .= 'Nevertheless, thank you for giving us the opportunity to consider your work. I am sorry that we cannot be more positive on this occasion and hope you are soon able to find an alternative journal. Although we cannot offer to publish your paper in '.$journal_info['title'].', the work may be appropriate for another journal in the TMR Publishing Group.

'; + $tt .= 'I have asked the editor of '.$trans_journal['title'].' ('.$trans_journal['website'].'), and there is a good chance that your manuscript will be published there. If you wish to transfer your manuscript to a journal of your choice, please click on the agree button in the Submission System, you will not have to re-supply manuscript metadata and files.



'; + $tt .= 'Yours Sincerely,
'; + $tt .= $journal_info['title'].' | Editorial Office
'; + $tt .= 'Email: '.$journal_info['email'].'
'; + $tt .= 'Website:'.$journal_info['website'].''; } }else if($data['state']==5){//录用 //录用后更新录用时间 @@ -497,17 +512,17 @@ 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_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 of TMR 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']==''?'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 .= 'Sincerely,
Editorial Office
'; }else if($data['state']==4){//退修 $tt = $article_info['accept_sn'].'
'; - $tt .= 'Dear '.($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']==''?'Authors':$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_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']==''?'Authors':$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'].'"
'; @@ -525,25 +540,19 @@ class Article extends Controller { if($data['state']==6){//进入终审,通知主编邮件 $chiefs = $this->chief_to_journal_obj->join('t_user','t_user.user_id = t_chief_to_journal.user_id','left')->where('t_chief_to_journal.journal_id',$journal_info['journal_id'])->where('t_chief_to_journal.state',0)->select(); foreach ($chiefs as $v){ - $tts = $article_info['accept_sn'].'
'; - $tts .= 'Dear Editor-in-Chief '.($v['realname']==''?'':$v['realname']).',
'; - $tts .= 'The manuscript entitled “'.$article_info['title'].'”is under fininal decision status of the journal '.$journal_info['title'].'.
'; - $tts .= '(The manuscripit in fininal decision status has been peer-reviewed, and the authors had revised all review opinions.)
'; - $tts .= 'The editorial office would be most grateful if you could offer an opinion regarding its suitability for publication in the journal Traditional Medicine Research. You can also invite 2-3 editorial board members to give their own ' - . 'comments on the manuscript by submission system.(Plese click here
'; - $tts .= 'Any comments and decisions you make will be valued by the editorial board and the editor in chief. If you choose not to make a decision on this article, you need not to reply and log in the submission system, we will refer to the opinions of other experts.
'; - $tts .= 'Please bring into our knowledge if there is any potential Conflict of Interest.

'; - $tts .= 'Thank you for your consideration.
'; - $tts .= 'Look forward for your reply.
'; - $tts .= 'Reviewer Center
'; - $tts .= 'Your username:'.$v['account'].'

'; - $tts .= 'Sincerely,
'; - $tts .= 'Editorial Office
'; - $tts .= $journal_info['title'].'
'; + $tts = 'Dear Dr. '.($v['realname']==''?$v['account']:$v['realname']).',

'; + $tts .= 'The manuscript entitled “'.$article_info['title'].'” has been peer-reviewed, revised and about to be published in '.$journal_info['title'].'.

'; + $tts .= 'If you want to review this article, you could use it Submission System (Plese click here).
'; + $tts .= 'Your username: '.$v['account'].'
'; + $tts .= 'Password: 123456qwe (Original password)

'; + $tts .= 'If you are unable to review it now, you may provide your comments at a later time at your convenience. Then ,there is no need to reply to this email.

'; + $tts .= 'Any comments you make will be valued by the editorial board. Please bring into our knowledge if there is any potential Conflict of Interest.



'; + $tts .= 'Sincerely,
Editorial Office
'.$journal_info['title'].'
'; $tts .= 'Email: '.$journal_info['email'].'
'; - $tts .= 'Website: '.$journal_info['website']; + $tts .= 'Website:'.$journal_info['website'].''; + sendEmail($v['email'], $journal_info['title'], $journal_info['title'], $tts, $journal_info['email'], $journal_info['epassword']); } - sendEmail($v['email'], $journal_info['title'], $journal_info['title'], $tts, $journal_info['email'], $journal_info['epassword']); + } //转投操作 @@ -568,6 +577,25 @@ class Article extends Controller { return json(['code' => 0]); } + + public function emailtest(){ + $v = $this->user_obj->where('user_id',54)->find(); + $journal_info = $this->journal_obj->where('journal_id',9)->find(); + $trans_journal = $this->journal_obj->where('journal_id',5)->find(); + $article_info = $this->article_obj->where('article_id',1058)->find(); + $tts = 'Dear Dr. '.($v['realname']==''?$v['account']:$v['realname']).',

'; + $tts .= 'The manuscript entitled “'.$article_info['title'].'” has been peer-reviewed, revised and about to be published in '.$journal_info['title'].'.

'; + $tts .= 'If you want to review this article, you could use it Submission System (Plese click here).
'; + $tts .= 'Your username: '.$v['account'].'
'; + $tts .= 'Password: 123456qwe (Original password)

'; + $tts .= 'If you are unable to review it now, you may provide your comments at a later time at your convenience. Then ,there is no need to reply to this email.

'; + $tts .= 'Any comments you make will be valued by the editorial board. Please bring into our knowledge if there is any potential Conflict of Interest.



'; + $tts .= 'Sincerely,
Editorial Office
'.$journal_info['title'].'
'; + $tts .= 'Email: '.$journal_info['email'].'
'; + $tts .= 'Website:'.$journal_info['website'].''; + sendEmail($v['email'], $journal_info['title'], $journal_info['title'], $tts, $journal_info['email'], $journal_info['epassword']); + } + private function creatLoginUrlForChief($user,$article_id){ $code = md5(time().rand(1000,9999).'thinkphp'); $insert['user_id'] = $user['user_id']; @@ -617,7 +645,8 @@ class Article extends Controller { $data = $this->request->post(); $article_info = $this->article_obj->where(['article_id' => $data['articleId']])->find(); // $author_info = $this->user_obj->where('user_id',$article_info['user_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(); + $editor_info = $this->user_obj->where(['user_id' => $journal_info['editor_id']])->find(); // $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find(); //存储文件入文件表 @@ -670,15 +699,18 @@ class Article extends Controller { $data = $this->request->post(); $article_info = $this->article_obj->where('article_id', $data['articleId'])->find(); - $editor_info = $this->user_obj->where('user_id', $article_info['editor_id'])->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(); + $editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find(); + $reviewer_info = $this->user_obj->where('user_id', $data['uid'])->find(); + $reviewer_move = $this->user_reviewer_info_obj->where("reviewer_info_id",$reviewer_info['user_id'])->find(); +// $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find(); //增加信息到文章审稿表 $insert_data['reviewer_id'] = $data['uid']; $insert_data['article_id'] = $data['articleId']; $insert_data['editor_act'] = 1; $insert_data['ctime'] = time(); + $insert_data['state'] = 5; $res = $this->article_reviewer_obj->insertGetId($insert_data); //修改文章状态->审稿中 @@ -694,16 +726,18 @@ class Article extends Controller { //发送email提醒审稿员 $tt = $article_info['accept_sn'] . '
'; - $tt .= 'Dear '.$reviewer_info['realname'].'

'; + $tt .= 'Dear '.($reviewer_move==null||$reviewer_move['technical']=="Others"||$reviewer_move['technical']==""?"Dr.":$reviewer_move['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 .= 'Click here to review the article
'; + $tt .= 'Click here to review the article
'; +// $tt .= 'Click on the link to reject the review of this manuscript
'; $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 .= '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'].'
'; @@ -778,6 +812,11 @@ class Article extends Controller { //接受参数,查询信息 $data = $this->request->post(); $user_res = $this->user_obj->where('account', $data['username'])->find(); + + if($user_res['account']=='fariba'||$user_res['account']=='Mohammad Hossein'||$user_res['account']=='xiaoyueyue'||$user_res['account']=='sethlee000'||$user_res['account']=='yuanying9908'){ + return json(['code'=>1,'msg'=>'Your account has been blocked. Please contact the publisher for details: publisher@tmrjournals.com.']); + } + $journal_info = $this->journal_obj->where('journal_id', $data['journal'])->find(); Db::startTrans(); @@ -849,9 +888,9 @@ class Article extends Controller { $tt = 'Dear editor,
'; $tt .= 'Please check the new manuscript in the submission system.'; 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_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']==''?'Authors':$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.

'; @@ -953,7 +992,11 @@ class Article extends Controller { $data = $this->request->post(); $limit_start = $data['pageIndex'] == 1 ? 0 : ($data['pageIndex'] - 1) * $data['pageSize'] - 1; $where['t_article_reviewer.article_id'] = $data['articleId']; - $res = $this->article_reviewer_obj->field('t_article_reviewer.*,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')->join('t_user_reviewer_info', 't_article_reviewer.reviewer_id = t_user_reviewer_info.reviewer_id', 'LEFT')->join('t_reviewer_major', 't_reviewer_major.major_id = t_user_reviewer_info.major', 'LEFT')->where($where)->limit($limit_start, $data['pageSize'])->select(); + $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') + ->join('t_user_reviewer_info', 't_article_reviewer.reviewer_id = t_user_reviewer_info.reviewer_id', 'LEFT') + ->join('t_reviewer_major', 't_reviewer_major.major_id = t_user_reviewer_info.major', 'LEFT') + ->where($where)->limit($limit_start, $data['pageSize'])->select(); $count = $this->article_reviewer_obj->where($where)->count(); if ($res) { return json(['code' => 0, 'data' => $res, 'totle' => $count]); @@ -977,7 +1020,10 @@ class Article extends Controller { */ public function getReviewerdetail() { $uid = $this->request->post('uid'); - $res = $this->user_obj->field('t_user.*,t_user_reviewer_info.*,t_reviewer_major.title major_title')->join('t_user_reviewer_info', 't_user.user_id = t_user_reviewer_info.reviewer_id', 'LEFT')->join('t_reviewer_major', 't_reviewer_major.major_id = t_user_reviewer_info.major', 'LEFT')->where('t_user.user_id', $uid)->find(); + $res = $this->user_obj->field('t_user.*,t_user_reviewer_info.*,t_reviewer_major.title major_title') + ->join('t_user_reviewer_info', 't_user.user_id = t_user_reviewer_info.reviewer_id', 'LEFT') + ->join('t_reviewer_major', 't_reviewer_major.major_id = t_user_reviewer_info.major', 'LEFT') + ->where('t_user.user_id', $uid)->find(); return json(['code' => 0, 'data' => $res]); } @@ -986,16 +1032,34 @@ class Article extends Controller { */ public function getArticleReviewerList() { $data = $this->request->post(); + $article_info = $this->article_obj->where('article_id', $data['articleId'])->find(); - $revids = $this->reviewer_to_journal_obj->where('journal_id', $article_info['journal_id'])->where('state',0)->column('reviewer_id'); +// $revids = $this->reviewer_to_journal_obj->where('journal_id', $article_info['journal_id'])->where('state',0)->column('reviewer_id'); $noids = $this->article_reviewer_obj->where('article_id', $data['articleId'])->column('reviewer_id'); - if ($noids != null) { - $where['t_user.user_id'] = [['in', $revids], ['not in', $noids]]; - } else { - $where['t_user.user_id'] = ['in', $revids]; - } - $res = $this->user_obj->field('t_user.*,t_user_reviewer_info.*')->join('t_user_reviewer_info', 't_user.user_id = t_user_reviewer_info.reviewer_id', 'LEFT')->where($where)->select(); + + $res = $this->reviewer_to_journal_obj + ->field('t_user.user_id,t_user.account') + ->join('t_user','t_user.user_id = t_reviewer_to_journal.reviewer_id','left') + ->join('t_user_reviewer_info', 't_user.user_id = t_user_reviewer_info.reviewer_id', 'LEFT') + ->where('t_reviewer_to_journal.journal_id',$article_info['journal_id']) + ->where('t_user.user_id','not in',$noids) + ->where('t_user.state',0) + ->select(); + +// if ($noids != null) { +// $where['t_user.user_id'] = [['in', $revids], ['not in', $noids]]; +// } else { +// $where['t_user.user_id'] = ['in', $revids]; +// } +// $where['t_user.state'] = 0; +// $res = $this->user_obj->field('t_user.*,t_user_reviewer_info.*') +// ->join('t_user_reviewer_info', 't_user.user_id = t_user_reviewer_info.reviewer_id', 'LEFT') +// ->where($where) +// ->select(); +// +// echo $this->user_obj->getLastSql(); +// die; if ($res) { return json(['code' => 0, 'data' => $res]); } else { diff --git a/application/api/controller/Board.php b/application/api/controller/Board.php index 974cb00..ac050df 100644 --- a/application/api/controller/Board.php +++ b/application/api/controller/Board.php @@ -74,7 +74,12 @@ class Board extends Controller { */ public function getBoardPendArticle() { $data = $this->request->post(); - $list = $this->article_obj->where('journal_id', $data['journal_id'])->where('state', 6)->select(); + $list = $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.journal_id', $data['journal_id']) + ->where('t_article.state', 6) + ->select(); foreach ($list as $k => $v) { $auts = $this->article_author_obj->where('article_id', $v['article_id'])->where('state', 0)->select(); $au = ''; @@ -89,6 +94,14 @@ class Board extends Controller { } } + //加上文章领域 + foreach($list 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(); + $list[$k]['major'] = $major['title']; + $list[$k]['cmajor'] = $cmajor['title']; + } + $re['articles'] = $list; return jsonSuccess($re); } @@ -107,7 +120,10 @@ class Board extends Controller { */ public function getBoardHistArticles(){ $data = $this->request->post(); - $list = $this->article_obj->where('journal_id',$data['journal_id'])->where('state',5)->select(); + $list = $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.journal_id',$data['journal_id']) + ->where('t_article.state',5)->select(); foreach ($list as $k => $v) { $auts = $this->article_author_obj->where('article_id', $v['article_id'])->where('state', 0)->select(); $au = ''; @@ -149,6 +165,29 @@ class Board extends Controller { return jsonSuccess($re); } + /** + * @title 青年编委详情页--获取青年编委期刊列表 + * @description 青年编委详情页--获取青年编委期刊列表 + * @author wangjinlei + * @url /api/Board/getYboardJournals + * @method POST + * + * @param name:user_id type:int require:1 desc:编委用户id + * + * @return journals:期刊列表# + */ + public function getYboardJournals(){ + $data = $this->request->post(); + $journals = $this->reviewer_to_journal_obj + ->join('t_journal','t_journal.journal_id = t_reviewer_to_journal.journal_id','left') + ->where('t_reviewer_to_journal.reviewer_id',$data['user_id']) + ->where('t_reviewer_to_journal.is_yboard',1) + ->where('t_reviewer_to_journal.state',0) + ->select(); + $re['journals'] = $journals; + return jsonSuccess($re); + } + /** * @title 编委导入--获取官网编委 * @description 编委导入--获取官网编委 diff --git a/application/api/controller/Chief.php b/application/api/controller/Chief.php index 0880900..fbcbafd 100644 --- a/application/api/controller/Chief.php +++ b/application/api/controller/Chief.php @@ -168,6 +168,7 @@ class Chief extends Controller { foreach ($aus as $k => $v){ $au .= $v['firstname'].' '.$v['lastname'].';'; } + $article_info['type'] = translateType($article_info['type']); $article_info['author'] = substr($au, 0,-1); $files = $this->article_file_obj->where('article_id',$article_info['article_id'])->where('type_name','manuscirpt')->select(); $article_info['file'] = $files; @@ -214,7 +215,12 @@ class Chief extends Controller { */ public function getPArticlesForChief() { $data = $this->request->post(); - $list = $this->article_obj->where('journal_id',$data['journal_id'])->where('state',6)->select(); + $list = $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.journal_id',$data['journal_id']) + ->where('t_article.state',6) + ->select(); foreach ($list as $k => $v){ $auts = $this->article_author_obj->where('article_id',$v['article_id'])->where('state',0)->select(); $au = ''; @@ -230,6 +236,15 @@ class Chief extends Controller { $list[$k]['type'] = translateType($v['type']); } } + + //加上文章领域 + foreach($list 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(); + $list[$k]['major'] = $major['title']; + $list[$k]['cmajor'] = $cmajor['title']; + } + $re['articles'] = $list; return jsonSuccess($re); } @@ -249,7 +264,11 @@ class Chief extends Controller { public function getHArticlesForChief(){ $data = $this->request->post(); $limit_start = ($data['pageIndex'] - 1) * $data['pageSize']; - $list = $this->article_obj->where('journal_id',$data['journal_id'])->where('state',5)->limit($limit_start,$data['pageSize'])->select(); + $list = $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.journal_id',$data['journal_id']) + ->where('t_article.state',5) + ->limit($limit_start,$data['pageSize'])->select(); foreach ($list as $k => $v){ $auts = $this->article_author_obj->where('article_id',$v['article_id'])->where('state',0)->select(); $au = ''; @@ -264,6 +283,13 @@ class Chief extends Controller { $list[$k]['type'] = translateType($v['type']); } } + //加上文章领域 + foreach($list 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(); + $list[$k]['major'] = $major['title']; + $list[$k]['cmajor'] = $cmajor['title']; + } $re['count'] = $count; $re['articles'] = $list; return jsonSuccess($re); @@ -353,6 +379,23 @@ class Chief extends Controller { return jsonSuccess([]); } + /** + * @title 获取期刊详情 + * @description 获取期刊详情 + * @author wangjinlei + * @url /api/Chief/getJournalDetail + * @method POST + * + * @param name:journal_id type:int require:1 desc:期刊id + */ + public function getJournalDetail(){ + $data = $this->request->post(); + $journal = $this->journal_obj->where('journal_id',$data['journal_id'])->find(); + + $re['journal'] = $journal; + return jsonSuccess($re); + } + /** * @title 删除主编期刊对应关系 * @description 删除主编期刊对应关系 @@ -663,6 +706,7 @@ class Chief extends Controller { $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(); $board_info = $this->user_obj->where('user_id',$data['board_id'])->find(); + $board_rev_info = $this->user_reviewer_info_obj->where("reviewer_id",$board_info['user_id'])->find(); $check = $this->article_to_board_obj->where('article_id',$data['article_id'])->where('board_id',$data['board_id'])->find(); if($check!=null){ return jsonError('Applied!'); @@ -674,7 +718,7 @@ class Chief extends Controller { //发送邮件给编委,并创造直连链接 $tt = $article_info['accept_sn'].'
'; - $tt .= 'Dear '.($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['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'].'.
'; @@ -739,7 +783,13 @@ class Chief extends Controller { */ public function getArticleBoard(){ $data = $this->request->post(); - $list = $this->article_to_board_obj->join('t_user','t_user.user_id = t_article_to_board.board_id','left')->where('t_article_to_board.article_id',$data['article_id'])->where('t_article_to_board.state',0)->select(); + $list = $this->article_to_board_obj + ->field('t_user.*,t_reviewer_major.ctitle major_title,t_user_reviewer_info.field field') + ->join('t_user','t_user.user_id = t_article_to_board.board_id','left') + ->join('t_user_reviewer_info','t_user_reviewer_info.reviewer_id = t_user.user_id','left') + ->join('t_reviewer_major','t_reviewer_major.major_id = t_user_reviewer_info.major','left') + ->where('t_article_to_board.article_id',$data['article_id']) + ->where('t_article_to_board.state',0)->select(); $re['boards'] = $list; return jsonSuccess($re); @@ -753,16 +803,29 @@ class Chief extends Controller { * @method POST * * @param name:journal_id type:int require:1 desc:期刊id + * @param name:pageIndex type:int require:1 desc:当前页码 + * @param name:pageSize type:int require:1 desc:每个页面的数据条数 * * @return boards:编委池# */ public function getAllArticleBoards(){ $data = $this->request->post(); - $list = $this->board_to_journal_obj->join('t_user','t_user.user_id = t_board_to_journal.user_id') + $limit_start = ($data['pageIndex'] - 1) * $data['pageSize']; + $list = $this->board_to_journal_obj + ->field('t_user.*,t_reviewer_major.ctitle major_title,t_user_reviewer_info.field field') + ->join('t_user','t_user.user_id = t_board_to_journal.user_id') + ->join('t_user_reviewer_info','t_user_reviewer_info.reviewer_id = t_user.user_id','left') + ->join('t_reviewer_major','t_reviewer_major.major_id = t_user_reviewer_info.major','left') ->where('t_board_to_journal.journal_id',$data['journal_id']) - ->where('t_board_to_journal.state',0)->select(); - + ->where('t_board_to_journal.state',0) + ->limit($limit_start,$data['pageSize']) + ->select(); + $count = $this->board_to_journal_obj + ->where('t_board_to_journal.journal_id',$data['journal_id']) + ->where('t_board_to_journal.state',0) + ->count(); $re['boards'] = $list; + $re['count'] = $count; return jsonSuccess($re); } diff --git a/application/api/controller/Reviewer.php b/application/api/controller/Reviewer.php index 0b9f49d..afce28c 100644 --- a/application/api/controller/Reviewer.php +++ b/application/api/controller/Reviewer.php @@ -84,7 +84,7 @@ class Reviewer extends Controller { $data = $this->request->post(); //获取审稿人基本信息 $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.type,t_journal.title journal_title,t_article.accept_sn accept_sn') + $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']) @@ -95,6 +95,14 @@ class Reviewer extends Controller { $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(); + $res[$k]['major'] = $major['title']; + $res[$k]['cmajor'] = $cmajor['title']; + } + $re['lists'] = $res; return jsonSuccess($re); } @@ -114,14 +122,13 @@ class Reviewer extends Controller { */ 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.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.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') ->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_reviewer.state','in',[1,2,3,4]) ->order('t_article_reviewer.state') ->limit($limit_start, $data['pageSize']) ->select(); @@ -130,7 +137,45 @@ class Reviewer extends Controller { $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(); + $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(); $re['lists'] = $res; + $re['count'] = $count; + return jsonSuccess($re); + } + + /** + * @title 审稿实例详情----主动申请审稿实例详情 + * @description 审稿实例详情----主动申请审稿实例详情 + * @author wangjinlei + * @url /api/Reviewer/getArtRevDetail + * @method POST + * + * @param name:article_id type:int require:1 desc:文章id + * @param name:user_id type:int require:1 desc:用户id + * + * @return lists:数据列表# + */ + 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){ + 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']) + ->find(); + $re['article'] = $article; return jsonSuccess($re); } @@ -151,6 +196,29 @@ class Reviewer extends Controller { return json(['data'=>$base_info]); } + /** + * @title 获取审稿人详情通过用户名或邮箱 + * @description 获取审稿人详情通过用户名或邮箱 + * @author wangjinlei + * @url /api/Reviewer/getReviewerByNameEmail + * @method POST + * + * @param name:account type:string require:1 desc:用户名或邮箱 + * + * @return reviewer:审稿人详情信息# + */ + 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) + ->find(); + $check['title'] = $check['technical']; + $re['reviewer'] = $check; + return jsonSuccess($re); + } + /** * @title 获取审稿人详情 * @description 获取审稿人详情 @@ -367,13 +435,14 @@ class Reviewer extends Controller { $data = $this->request->post(); //查询实例数据 - $res = $this->article_reviewer_obj->field('t_article_reviewer.*,t_journal.*,t_article.title article_title,t_article.accept_sn accept_sn,t_user.account account') + $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') ->where('t_article_reviewer.art_rev_id', $data['revid']) ->find(); - + //文章类型转译 + $res['atype'] = translateType($res['atype']); //更改实例状态(消息提醒) if($data['human']=='editor'){ $up_data['reviewer_act'] = 0; @@ -384,7 +453,78 @@ class Reviewer extends Controller { return json($res); } + + /** + * @title 申请审稿实例 + * @description 申请审稿实例 + * @author wangjinlei + * @url /api/Reviewer/addArticleReviewer + * @method POST + * + * @param name:articleId type:int require:1 desc:文章id + * @param name:uid type:int require:1 desc:用户id + */ + 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(); + //增加信息到文章审稿表 + $insert_data['reviewer_id'] = $data['uid']; + $insert_data['article_id'] = $data['articleId']; + $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']); + + return jsonSuccess([]); + } + + /** + * @title 获取文章详情 + * @description 获取文章详情 + * @author wangjinlei + * @url /api/Reviewer/getArticleDetail + * @method POST + * + * @param name:article_id type:int require:1 desc:文章id + */ + 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']) + ->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 提交问卷(审稿人) @@ -421,16 +561,47 @@ class Reviewer extends Controller { * @param name:other type:int require:1 desc:其他 * @param name:confident type:string require:1 desc:对编辑的意见 * @param name:comment type:string require:1 desc:对作者的意见 + * @param name:is_anonymous string require:1 desc:是否匿名0否1是 * */ public function questionSubmit() { //接受参数,查询基础数据 $data = $this->request->post(); +// $data['rev_qu_id'] = 3; +// $data['art_rev_id'] = 23; +// $data['qu1'] = 1; +// $data['qu2'] = 2; +// $data['qu3'] = 3; +// $data['qu4'] = 1; +// $data['qu5'] = 4; +// $data['qu6'] = 2; +// $data['qu7'] = 3; +// $data['qu8'] = 1; +// $data['qu9'] = 2; +// $data['qu9contents'] = ''; +// $data['qu10'] = 'true'; +// $data['qu10contents'] = ''; +// $data['qu11'] = 'true'; +// $data['qu11contents'] = ''; +// $data['qu12'] = 'true'; +// $data['qu12contents'] = ''; +// $data['qu13'] = 'true'; +// $data['qu13contents'] = ''; +// $data['qu14'] = 'true'; +// $data['qu14contents'] = ''; +// $data['qu15'] = 'true'; +// $data['qu15contents'] = ''; +// $data['rated'] = 7; +// $data['recommend'] = 2; +// $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',$article_info['editor_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']; @@ -460,6 +631,7 @@ class Reviewer extends Controller { $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; if ($data['rev_qu_id'] == '') {//新增 $insert_data['ctime'] = time(); $res = $this->article_reviewer_question_obj->insert($insert_data); @@ -499,7 +671,7 @@ class Reviewer extends Controller { $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); //记录usermsg - add_usermsg($article_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]); } @@ -540,6 +712,7 @@ class Reviewer extends Controller { * @url /api/Reviewer/getAllReviewerList * @method POST * + * @param name:user_id type:int require:1 desc:审稿人userid * @param name:journal_id type:int require:1 desc:期刊id * @param name:pageIndex type:int require:1 desc:当前页码 * @param name:pageSize type:int require:1 desc:每个页面的数据条数 @@ -550,17 +723,97 @@ class Reviewer extends Controller { public function getAllReviewerList(){ $data = $this->request->post(); $limit_start = ($data['pageIndex'] - 1) * $data['pageSize']; - $arts = $this->article_obj->where('journal_id',$data['journal_id'])->where('state',2)->limit($limit_start,$data['pageSize'])->select(); - $count = $this->article_obj->where('journal_id',$data['journal_id'])->where('state',2)->count(); - + $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'); + $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']) + ->select(); + $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(); + } + 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(); + $arts[$k]['major'] = $major['title']; + $arts[$k]['cmajor'] = $cmajor['title']; + } $re['articles'] = $arts; $re['count'] = $count; return jsonSuccess($re); } /** - * @title 发起审稿 - * @description 发起审稿 + * @title 获取审稿人证书 + * @description 获取审稿人证书 + * @author wangjinlei + * @url /api/Reviewer/getZSimg + * @method POST + * + * @param name:art_rev_id type:int require:1 desc:文章审稿实例id + */ + 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(); +// if($article_info['rtime']==0){ +// return jsonError('Certificate not issued'); +// } + 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(); +// $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']; + + $template = ROOT_PATH . 'public' . DS . 'reviewerZS' . DS . 'zs.jpg'; + $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'); + } + + /** + * @title 审稿人申请审稿 + * @description 审稿人申请审稿 * @author wangjinlei * @url /api/Reviewer/launchReviewer * @method POST @@ -571,10 +824,18 @@ class Reviewer extends Controller { */ 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){ + 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){ @@ -588,7 +849,7 @@ class Reviewer extends Controller { $res = $this->article_reviewer_obj->insertGetId($insert_data); //发送email提醒审稿员 $tt = $article_info['accept_sn'] . '
'; - $tt .= 'Dear '.$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']==''?'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' . ' be most grateful if you could offer an opinion regarding its suitability for publication' @@ -618,6 +879,73 @@ class Reviewer extends Controller { return $url; } + /** + * @title 审稿人同意审稿 + * @description 审稿人同意审稿 + * @author wangjinlei + * @url /api/Reviewer/agreeReviewerArticle + * @method POST + * + * @param name:art_rev_id type:int require:1 desc:文章审稿id + */ + public function agreeReviewerArticle(){ + $data = $this->request->post(); + $this->article_reviewer_obj->where('art_rev_id',$data['art_rev_id'])->update(['state'=>0]); + + return jsonSuccess([]); + } + + /** + * @title 审稿人拒绝审稿 + * @description 审稿人拒绝审稿 + * @author wangjinlei + * @url /api/Reviewer/refuseReviewerArticle + * @method POST + * + * @param name:art_rev_id type:int require:1 desc:文章审稿id + */ + public function refuseReviewerArticle(){ + $data = $this->request->post(); + $this->article_reviewer_obj->where('art_rev_id',$data['art_rev_id'])->update(['state'=>4]); + + return jsonSuccess([]); + } + + /** + * @title 获取邀请审稿实例列表 + * @description 获取邀请审稿实例列表 + * @author wangjinlei + * @url /api/Reviewer/getInvitatReviewList + * @method POST + * + * @param name:user_id type:int require:1 desc:审稿人id + */ + 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) + ->select(); + 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(); + $res[$k]['major'] = $major['title']; + $res[$k]['cmajor'] = $cmajor['title']; + } + + $re['articles'] = $res; + return jsonSuccess($re); + } + /** * @title 审查用户是否有审稿的权限 * @description 审查用户是否有审稿的权限 @@ -630,9 +958,8 @@ class Reviewer extends Controller { */ public function checkUserForReviewer(){ $data = $this->request->post(); - $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){ + $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{ return jsonError('No permission'); @@ -770,7 +1097,7 @@ class Reviewer extends Controller { if($uid && $res1&&$res2){ Db::commit(); //发送邮件通知审稿人 - $content = "Thank you for registering as a " . $journal_info['title'] . " reviewer
". "At present, you have passed our examination
"; + $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

'; @@ -785,9 +1112,59 @@ class Reviewer extends Controller { Db::rollback(); return jsonError('add error!'); } - } + /** + * @title 添加reviewer(已存在用户) + * @description 添加reviewer(已存在用户) + * @author wangjinlei + * @url /api/Reviewer/addReviewerBee + * @method POST + * + * @param name:journal_id type:int require:1 desc:期刊id + * @param name:user_id type:int require:1 desc:用户id + * @param name:gender type:int require:1 desc:性别 + * @param name:title type:string require:1 desc:用户title + * @param name:country type:string require:1 desc:国家 + * @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:单位 + */ + 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){ + 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['major'] = $data['major']; + $info_insert['cmajor'] = $data['cmajor']; + $info_insert['field'] = trim($data['field']); + 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); + } + + $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 获取审稿人列表 @@ -800,7 +1177,6 @@ class Reviewer extends Controller { * @param name:journalId type:int require:1 desc:期刊id当全选时为0 * @param name:pageIndex type:int require:1 desc:开始页码 * @param name:pageSize type:int require:1 desc:每页是数据条数 - * */ public function getReviewerListByJournal() { $data = $this->request->post(); @@ -858,6 +1234,11 @@ class Reviewer extends Controller { return $this->article_reviewer_file_obj->insert($insert_data); } + + public function pdft(){ + $this->pdftest('I am wjl'); + } + /** * 生成pdf感谢reviewer */ diff --git a/application/api/controller/Staff.php b/application/api/controller/Staff.php index e596242..35a3644 100644 --- a/application/api/controller/Staff.php +++ b/application/api/controller/Staff.php @@ -115,7 +115,7 @@ class Staff extends Controller { */ public function delStaff() { $data = $this->request->post(); - $this->staff_obj->where('staff_id', $data['staff_id'])->update(['state' => 1]); + $this->staff_obj->where('staff_id', $data['staff_id'])->delete(); return jsonSuccess([]); } @@ -233,6 +233,38 @@ class Staff extends Controller { return jsonSuccess($res); } } + + public function ggg(){ + $staff_list = $this->staff_obj->where('staff_id',27)->select(); + $c_time = strtotime("-1 month", strtotime(date('Y-m') . '-26 00:00:00')); + $c_time1 = strtotime(date('Y-m' . '-25 23:59:59')); + $where['ctime'] = array(['>', $c_time], ['<=', $c_time1]); + foreach ($staff_list as $value) { + $base_price = $this->getBasePrice($value['name']); + $journals = $this->journal_obj->where('staff_id', $value['staff_id'])->select(); + $journal_price = 0; + $cite_price = 0; + if($value['type']==0){ + foreach ($journals as $v) { + $c_price = 0; + $where['accept_sn'] = ['like',$v['abbr'].'%']; + $cache_articles = $this->article_obj->where($where)->select(); + + echo '
';
+                    var_dump($cache_articles);
+                    echo '
'; + die; + + } + + } + + } + } + + + + /** * 核算月薪,记录进log(系统自动调用) @@ -251,7 +283,6 @@ class Staff extends Controller { if($value['type']==0){ foreach ($journals as $v) { $c_price = 0; - // $where['journal_id'] = $v['journal_id']; $where['accept_sn'] = ['like',$v['abbr'].'%']; $cache_articles = $this->article_obj->where($where)->select(); $c_gn = 0; @@ -456,6 +487,76 @@ class Staff extends Controller { $re['sub_price'] = 0; return $re; } + + public function getgrtc(){ + + $staff_info = $this->staff_obj->where('name', $name)->where('state',0)->find(); + $baseprice = $this->getBasePrice($name); + //获取实时期刊提成情况 + $c_time = strtotime("-1 month", strtotime(date('Y-m') . '-26 00:00:00')); + $c_time1 = strtotime(date('Y-m' . '-25 23:59:59')); + $where['ctime'] = array(['>', $c_time], ['<=', $c_time1]); + $journals = $this->journal_obj->where('staff_id', $staff_info['staff_id'])->select(); + $journal_price = 0; + $cite_price = 0; + if($staff_info['type']==0){ + foreach ($journals as $v) { + $c_price = 0; + $where['accept_sn'] = ['like',$v['abbr'].'%']; + $cache_articles = $this->article_obj->where($where)->select(); + + echo '
';
+                var_dump($cache_articles);
+                echo '
'; + + $c_gn = 0; + $c_gw = 0; + foreach ($cache_articles as $vv) { + $c_country = $this->article_author_obj->where('article_id', $vv['article_id'])->where('state', 0)->column('country'); + $c_c = 'gn'; + foreach ($c_country as $vvv) { + if ($vvv != 'China' && $vvv != '') { + $c_c = 'gw'; + } + } + if ($c_c == 'gn') { + $c_gn++; + } else { + $c_gw++; + } + } + if ($c_gn - $v['jour_num'] >= 0) { + $c_price = ($c_gn - $v['jour_num']) * 100 + $c_gw * 200; + } else { + if (($c_gw - ($v['jour_num'] - $c_gn)) >= 0) { + $c_price = ($c_gn + $c_gw - $v['jour_num']) * 200; + } else { + $c_price = 0 - ($v['jour_num'] - $c_gn - $c_gw) * 50; + } + } + $journal_price += $c_price; + + //获取cite提成 + $jcites = json_decode(myPost(self::JURL,['issn'=>$v['issn']])); + $jcs = $jcites->data->cites; + $cite_price += count($jcs)*500; + } + + echo '------------------------------------------------'; + } + $re['staff_log_id'] = 0; + $re['baseprice'] = $baseprice; + $re['journalprice'] = $journal_price; + $re['citeprice'] = $cite_price; + $re['add_price'] = 0; + $re['sub_price'] = 0; + echo '
';
+        var_dump($re);
+        echo '
'; + die; + } + + private function getBasePrice($name) { $staff_info = $this->staff_obj->where('name', $name)->where('state', 0)->find(); diff --git a/application/api/controller/User.php b/application/api/controller/User.php index 154c28a..ce34a6b 100644 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -6,6 +6,7 @@ use think\Controller; use think\Db; use think\captcha; use think\Cache; +use think\Queue; /** * @title 用户相关接口 @@ -57,6 +58,10 @@ 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.']); + } + //判断是否管理员登录 if ($data['username'] == 'superadmin' || $data['username'] == 'wuxiongzhi2') { $where_admin['account'] = $data['username']; @@ -89,6 +94,32 @@ class User extends Controller { } } } + + /** + * 为所有用户发送邮件 + */ + public function pushEmail(){ + die; + $list = $this->user_obj->where('state',0)->select(); + //发送邮件通知审稿人 + foreach($list as $v){ + $content = "Dear Researcher,

"; + $content .= "We sincerely invite you to subscribe to our journal Traditional Medicine Research (TMR) (ISSN 2413-3973).
"; + $content .= "If you are interested in our journal,it is easy to subscribe to journals and topics on our official website. Please click here:
"; + $content .= "https://www.tmrjournals.com/draw_up.html?issn=2413-3973

"; + $content .= "Updates to the topics you have subscribed to will be sent to your mailbox.

"; + $content .= "Thank you for your attention to our invitation. If you have any questions, do not hesitate to contact us.

"; + $content .= "TMR is a peer-reviewed open access journal managed by TMR Publishing Group. TMR is dedicated to protecting and developing all types of traditional medicines, including traditional Chinese medicine, Persian medicine, Ayurveda, Siddha, minority medicine, etc., using the latest achievements in modern science. TMR emphasizes the historical origin and developmental pipeline of the research objective and encourages authors to analyze the theoretical significance underlying a study and the application of traditional medicine in clinical practice.

"; + $content .= "Best wishes,
"; + $content .= "TMR Publishing Group"; + $maidata['email'] = $v['email']; + $maidata['title'] = "Traditional Medicine Research"; + $maidata['content'] = $content; + $maidata['tmail'] = "tmrweb@tmrjournals.com"; + $maidata['tpassword'] = "Wu999999tmrwe"; + Queue::push( 'app\api\job\mail@fire' , $maidata , "tmail" ); + } + } /** * @title 审稿系统登录功能 @@ -396,7 +427,7 @@ class User extends Controller { $jous[] = $data['journalId']; } $res = $this->reviewer_to_journal_obj - ->field('t_reviewer_to_journal.is_yboard,t_user.*,t_user_reviewer_info.*,t_journal.*') + ->field('t_reviewer_to_journal.is_yboard,t_user_reviewer_info.*,t_journal.*,t_user.*') ->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') @@ -644,6 +675,9 @@ class User extends Controller { if ($user == null) { Cache::set($r->orcid, $res, 3600); } + $roles = $this->getUserRoles($user['account']); + $re['roles'] = $roles; + $re['userinfo'] = $user; $re['user'] = $user; $re['orcid'] = $r->orcid; return jsonSuccess($re); diff --git a/application/common.php b/application/common.php index 7ff3e96..c6cd9bf 100644 --- a/application/common.php +++ b/application/common.php @@ -185,6 +185,19 @@ function jsonError($msg){ return json(['code'=>1,'msg'=>$msg]); } +function choiseJabbr($article_id,$jabbr){ + if($article_id<1799&&$jabbr=="Cancer Adv"){ + return "TMR Cancer"; + } + if($article_id<910&&$jabbr=="Microenviron Microecol Res"){ + return "Tumor Microenviron Res"; + } + if($article_id<1799&&$jabbr=="Med Theor Hypothesis"){ + return "TMR Theory Hypoth"; + } + return $jabbr; +} + function myPost($url, $param=array()){ if(!is_array($param)){