This commit is contained in:
wangjinlei
2021-12-21 16:54:13 +08:00
parent b4f5cd59bb
commit e00dd3913b
8 changed files with 785 additions and 99 deletions

View File

@@ -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,<br>';
$tt .= 'The author changed the manuscripts 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'].'"<br>';
$tt .= $article_info['accept_sn'].'<br>';
$tt .= 'journal:'.$journal_info['title'].'<br>';
$tt .= 'Dear '.($user_info['realname']==''?'Authors':$user_info['realname']).',<br>';
$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']).',<br>';
$tt .= 'Thank you for submitting your paper to '.$journal_info['title'].'. Your manuscript has undergone review.<br>';
$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.<br><br>Yours sincerely,<br><br>';
$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.<br><br>Yours sincerely,<br><br>';
$tt .= 'Sincerely,<br>Editorial Office<br>';
$tt .= $journal_info['title'].'<br>';
$tt .= '<a href="https://www.tmrjournals.com/draw_up.html?issn='.$journal_info['issn'].'">Subscribe to this journal</a><br>';
@@ -468,10 +473,11 @@ class Article extends Controller {
//发送文章状态更改邮件
if($data['state']==3){//拒稿
if($data['trsjournal']==0){
$tt = '"'.$article_info['title'].'"<br>';
$tt .= $article_info['accept_sn'].'<br>';
$tt .= 'journal:'.$journal_info['title'].'<br>';
$tt .= 'Dear '.($user_info['realname']==''?'Authors':$user_info['realname']).',<br>';
$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']).',<br>';
$tt .= 'Thank you for submitting your paper to '.$journal_info['title'].'. Your manuscript has undergone review.<br>';
$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'].'"<br>';
$tt .= $article_info['accept_sn'].'<br>';
$tt .= 'journal:'.$journal_info['title'].'<br>';
$tt .= 'Dear '.($user_info['realname']==''?'Authors':$user_info['realname']).',<br>';
$tt .= 'Thank you for submitting your paper to '.$journal_info['title'].'. Your manuscript has undergone review.<br>';
$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.<br><br>';
$tt .= 'If you choose to pursue publication in '.$trans_journal['title'].', please click the folowing link to comfirm ('.$trans_journal['website'].').';
$tt .= '<br><br>Yours sincerely,<br><br>';
$tt .= 'Sincerely,<br>Editorial Office<br>';
// $tt = '"'.$article_info['title'].'"<br>';
// $tt .= $article_info['accept_sn'].'<br>';
// $tt .= 'journal:'.$journal_info['title'].'<br>';
// $tt .= 'Dear '.($user_info['realname']==''?'Authors':$user_info['realname']).',<br>';
// $tt .= 'Thank you for submitting your paper to '.$journal_info['title'].'. Your manuscript has undergone review.<br>';
// $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.<br><br>';
// $tt .= 'If you choose to pursue publication in '.$trans_journal['title'].', please click the folowing link to comfirm ('.$trans_journal['website'].').';
// $tt .= '<br><br>Yours sincerely,<br><br>';
// $tt .= 'Sincerely,<br>Editorial Office<br>';
$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']).'<br><br>';
$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.<br><br>';
$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. <br><br>';
$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 <a href="https://submission.tmrjournals.com">Submission System</a>, you will not have to re-supply manuscript metadata and files.<br><br><br><br>';
$tt .= 'Yours Sincerely,<br>';
$tt .= $journal_info['title'].' | Editorial Office<br>';
$tt .= 'Email: '.$journal_info['email'].'<br>';
$tt .= 'Website:<a href="'.$journal_info['website'].'">'.$journal_info['website'].'</a>';
}
}else if($data['state']==5){//录用
//录用后更新录用时间
@@ -497,17 +512,17 @@ class Article extends Controller {
$tt = 'Manuscript ID: '.$article_info['accept_sn'].'<br>';
$tt .= 'Manuscript Title: '.$article_info['title'].'<br>';
$tt .= 'Authors Name: '.self::getArticleAuthors($article_info['article_id']).'<br><br>';
$tt .= 'Dear '.($user_info['realname']==''?'Authors':$user_info['realname']).',<br>It is a distinct pleasure to inform you that your manuscript has been accepted for publication in '.$journal_info['title'].' (ISSN '.$journal_info['issn'].').<br> The editor of TMR will contact you further by email soon.<br><br><br>';
$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']).',<br>It is a distinct pleasure to inform you that your manuscript has been accepted for publication in '.$journal_info['title'].' (ISSN '.$journal_info['issn'].').<br> The editor will contact you further by email soon.<br><br><br>';
$tt .= 'Sincerely,<br>Editorial Office<br>';
}else if($data['state']==4){//退修
$tt = $article_info['accept_sn'].'<br>';
$tt .= 'Dear '.($user_info['realname']==''?'Authors':$user_info['realname']).',<br>';
$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']).',<br>';
$tt .= 'Thank you for submitting the manuscript to '.$journal_info['title'].'. <br>';
$tt .= 'Please find the new comments in the "<a href="http://submission.tmrjournals.com/submission?journal='.$journal_info['alias'].'">AuthorCenter</a>", Please submit your revised manuscript within two weeks.<br><br>';
$tt .= 'If you need more time to revise, you can send E-mial to tell us.<br>';
$tt .= 'Sincerely,<br>Editorial Office<br>';
}else if($data['state']==6){//终审
$tt = 'Dear '.($user_info['realname']==''?'Authors':$user_info['realname']).'<br>';
$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']).'<br>';
$tt .= 'Manuscript status: Your manuscript "'.$article_info['title'].'" is under reviewing by editorial member team of '.$journal_info['title'].'.';
}else{
$tt = '"'.$article_info['title'].'"<br>';
@@ -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'].'<br>';
$tts .= 'Dear Editor-in-Chief '.($v['realname']==''?'':$v['realname']).'<br>';
$tts .= 'The manuscript entitled “'.$article_info['title'].'”is under fininal decision status of the journal '.$journal_info['title'].'.<br>';
$tts .= '(The manuscripit in fininal decision status has been peer-reviewed, and the authors had revised all review opinions.)<br>';
$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.<a href="'.$this->creatLoginUrlForChief($v,$article_info['article_id']).'">Plese click here</a><br>';
$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.<br>';
$tts .= 'Please bring into our knowledge if there is any potential Conflict of Interest.<br><br>';
$tts .= 'Thank you for your consideration.<br>';
$tts .= 'Look forward for your reply.<br>';
$tts .= 'ReviewerCenter<br>';
$tts .= 'Your username:'.$v['account'].'<br><br>';
$tts .= 'Sincerely,<br>';
$tts .= 'Editorial Office<br>';
$tts .= $journal_info['title'].'<br>';
$tts = 'Dear Dr. '.($v['realname']==''?$v['account']:$v['realname']).',<br><br>';
$tts .= 'The manuscript entitled “'.$article_info['title'].'” has been peer-reviewed, revised and about to be published in '.$journal_info['title'].'.<br><br>';
$tts .= 'If you want to review this article, you could use it Submission System (<a href="https://submission.tmrjournals.com">Plese click here</a>).<br>';
$tts .= 'Your username: '.$v['account'].'<br>';
$tts .= 'Password: 123456qwe (Original password)<br><br>';
$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.<br><br>';
$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.<br><br><br><br>';
$tts .= 'Sincerely,<br>Editorial Office<br>'.$journal_info['title'].'<br>';
$tts .= 'Email: '.$journal_info['email'].'<br>';
$tts .= 'Website: '.$journal_info['website'];
$tts .= 'Website:<a href="'.$journal_info['website'].'">'.$journal_info['website'].'</a>';
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']).',<br><br>';
$tts .= 'The manuscript entitled “'.$article_info['title'].'” has been peer-reviewed, revised and about to be published in '.$journal_info['title'].'.<br><br>';
$tts .= 'If you want to review this article, you could use it Submission System (<a href="https://submission.tmrjournals.com">Plese click here</a>).<br>';
$tts .= 'Your username: '.$v['account'].'<br>';
$tts .= 'Password: 123456qwe (Original password)<br><br>';
$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.<br><br>';
$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.<br><br><br><br>';
$tts .= 'Sincerely,<br>Editorial Office<br>'.$journal_info['title'].'<br>';
$tts .= 'Email: '.$journal_info['email'].'<br>';
$tts .= 'Website:<a href="'.$journal_info['website'].'">'.$journal_info['website'].'</a>';
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'] . '<br>';
$tt .= 'Dear '.$reviewer_info['realname'].'<br><br>';
$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']).'<br><br>';
$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'].'. <br>';
$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.<br><br>';
$tt .= 'Thank you for your consideration.<br> Look forward for your reply.<br>';
$tt .= '<a href="'.$this->creatLoginUrlForreviewer($reviewer_info,$res).'">Click here to review the article</a><br>';
// $tt .= '<a href="'.$this->creatLoginUrlForreviewer($reviewer_info,$res).'">Click here to review the article</a><br>';
$tt .= '<a href="https://submission.tmrjournals.com/">Click here to review the article</a><br>';
// $tt .= '<a href="">Click on the link to reject the review of this manuscript</a><br>';
$tt .= 'Your username:'.$reviewer_info['account'].'<br><br>';
$tt .= 'Your original password:123456qwe , if you have reset the password, please login with the new one or click the "<a href="https://submission.tmrjournals.com/retrieve">forgot password</a>".<br>';
$tt .= 'Your original password:123456qwe, if you have reset the password, please login with the new one or click the "<a href="https://submission.tmrjournals.com/retrieve">forgot password</a>".<br>';
$tt .= 'Sincerely,<br>Editorial Office<br>';
$tt .= '<a href="https://www.tmrjournals.com/draw_up.html?issn='.$journal_info['issn'].'">Subscribe to this journal</a><br>';
$tt .= $journal_info['title'].'<br>';
@@ -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,<br>';
$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']).',<br><br>';
$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']).',<br><br>';
$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.<br><br><br>';
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.<br><br>';
@@ -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 {