This commit is contained in:
Administrator
2022-01-11 16:31:53 +08:00
parent 08df5a1977
commit a786f6f8e5
7 changed files with 899 additions and 345 deletions

View File

@@ -5,6 +5,10 @@ namespace app\api\controller;
use think\Controller; use think\Controller;
use think\Db; use think\Db;
/**
* @title 文章接口
* @description 文章接口
*/
class Article extends Controller { class Article extends Controller {
protected $article_obj = ''; protected $article_obj = '';
@@ -78,7 +82,22 @@ class Article extends Controller {
} }
/** /**
* 获取文章列表(编辑) * @title 获取文章列表(编辑)
* @description 获取文章列表(编辑)
* @author wangjinlei
* @url /api/Article/getArticleForEditor
* @method POST
*
* @param name:username type:string require:1 desc:编辑用户名
* @param name:journal type:int require:1 desc:期刊id
* @param name:state type:int require:1 desc:状态
* @param name:act type:int require:1 desc:1进行中2已完成
* @param name:sn type:string require:0 desc:流水号
* @param name:pageIndex type:int require:1 desc:当前页码
* @param name:pageSize type:int require:1 desc:每个页面的数据条数
*
* @return articles:文章列表#
* @return count:总数#
*/ */
public function getArticleForEditor() { public function getArticleForEditor() {
//接受参数 //接受参数
@@ -101,6 +120,9 @@ class Article extends Controller {
$where['t_article.state'] = array('in',[3,5]); $where['t_article.state'] = array('in',[3,5]);
} }
} }
if(isset($data['sn'])&& trim($data['sn'])!=""){
$where["t_article.accept_sn"] = trim($data['sn']);
}
if ($data['name'] != '') { if ($data['name'] != '') {
$where['t_article.title'] = array('like', "%" . $data['name'] . "%"); $where['t_article.title'] = array('like', "%" . $data['name'] . "%");
} }
@@ -246,6 +268,7 @@ class Article extends Controller {
$where['article_id'] = $data['articleId']; $where['article_id'] = $data['articleId'];
$up_res = $this->article_obj->where($where)->update($inset_data); $up_res = $this->article_obj->where($where)->update($inset_data);
$article_info = $this->article_obj->where($where)->find(); $article_info = $this->article_obj->where($where)->find();
$journal_info = $this->journal_obj->where("journal_id",$article_info["journal_id"])->find();
//更新作者信息 //更新作者信息
$aids = []; $aids = [];
@@ -321,7 +344,7 @@ class Article extends Controller {
$log_res=$this->user_log_obj->insert($log_data); $log_res=$this->user_log_obj->insert($log_data);
//增加usermsg //增加usermsg
$umsg_res=add_usermsg($article_info['editor_id'], 'The manuscript has new process: ' . $article_info['title'], '/articleDetailEditor?id=' . $article_info['article_id']); $umsg_res=add_usermsg($journal_info['editor_id'], 'The manuscript has new process: ' . $article_info['title'], '/articleDetailEditor?id=' . $article_info['article_id']);
if($up_res&&$msg_res&&$res1&&$res2&&$res3&&$res4&&$log_res&&$umsg_res){ if($up_res&&$msg_res&&$res1&&$res2&&$res3&&$res4&&$log_res&&$umsg_res){
Db::commit(); Db::commit();
@@ -380,11 +403,12 @@ class Article extends Controller {
sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt,$journal_info['email'],$journal_info['epassword']); sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt,$journal_info['email'],$journal_info['epassword']);
//添加usermsg //添加usermsg
add_usermsg($article_info['editor_id'], 'Manuscript authors be changed,please contact the author to confirm.', 'articleDetailEditor?id='.$data['articleId']); add_usermsg($journal_info['editor_id'], 'Manuscript authors be changed,please contact the author to confirm.', 'articleDetailEditor?id='.$data['articleId']);
return json(['code' => 0]); return json(['code' => 0]);
} }
/** /**
* 修改文章状态(编辑) * 修改文章状态(编辑)
*/ */
@@ -433,7 +457,7 @@ class Article extends Controller {
$tt .= $article_info['accept_sn'].'<br>'; $tt .= $article_info['accept_sn'].'<br>';
$tt .= 'journal:'.$journal_info['title'].'<br>'; $tt .= 'journal:'.$journal_info['title'].'<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 .= '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>';
$tt .= 'Thank you for submitting your paper to '.$journal_info['title'].'. Your manuscript has undergone review.<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. 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 .= '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 .= 'Sincerely,<br>Editorial Office<br>';
@@ -464,9 +488,15 @@ class Article extends Controller {
$this->article_obj->where($where_article)->update(['editor_act'=>1]); $this->article_obj->where($where_article)->update(['editor_act'=>1]);
return json(['code' => 0]); return json(['code' => 0]);
} }
//更新文章状态
$update_data['state'] = $data['state']; $update_data['state'] = $data['state'];
$update_data['editor_act'] = 1; $update_data['editor_act'] = 1;
//更新文章状态
if($data['state']==4){
$update_data['ttime'] = time();
}
if($data['state']==3){
$update_data['rstime'] = time();
}
$this->article_obj->where($where_article)->update($update_data); $this->article_obj->where($where_article)->update($update_data);
} }
@@ -477,7 +507,7 @@ class Article extends Controller {
$tt = '"'.$article_info['title'].'"<br>'; $tt = '"'.$article_info['title'].'"<br>';
$tt .= $article_info['accept_sn'].'<br>'; $tt .= $article_info['accept_sn'].'<br>';
$tt .= 'journal:'.$journal_info['title'].'<br>'; $tt .= 'journal:'.$journal_info['title'].'<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 .= '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>';
$tt .= 'Thank you for submitting your paper to '.$journal_info['title'].'. Your manuscript has undergone review.<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,' $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. ' . ' and we are returning your manuscript to you so that you can submit it to another journal without delay. '
@@ -512,23 +542,23 @@ class Article extends Controller {
$tt = 'Manuscript ID: '.$article_info['accept_sn'].'<br>'; $tt = 'Manuscript ID: '.$article_info['accept_sn'].'<br>';
$tt .= 'Manuscript Title: '.$article_info['title'].'<br>'; $tt .= 'Manuscript Title: '.$article_info['title'].'<br>';
$tt .= 'Authors Name: '.self::getArticleAuthors($article_info['article_id']).'<br><br>'; $tt .= 'Authors Name: '.self::getArticleAuthors($article_info['article_id']).'<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 .= '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>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>'; $tt .= 'Sincerely,<br>Editorial Office<br>';
}else if($data['state']==4){//退修 }else if($data['state']==4){//退修
$tt = $article_info['accept_sn'].'<br>'; $tt = $article_info['accept_sn'].'<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 .= '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>';
$tt .= 'Thank you for submitting the manuscript to '.$journal_info['title'].'. <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 .= '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 .= 'If you need more time to revise, you can send E-mial to tell us.<br>';
$tt .= 'Sincerely,<br>Editorial Office<br>'; $tt .= 'Sincerely,<br>Editorial Office<br>';
}else if($data['state']==6){//终审 }else if($data['state']==6){//终审
$tt = 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?'Authors':$user_info['realname']).'<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>';
$tt .= 'Manuscript status: Your manuscript "'.$article_info['title'].'" is under reviewing by editorial member team of '.$journal_info['title'].'.'; $tt .= 'Manuscript status: Your manuscript "'.$article_info['title'].'" is under reviewing by editorial member team of '.$journal_info['title'].'.';
}else{ }else{
$tt = '"'.$article_info['title'].'"<br>'; $tt = '"'.$article_info['title'].'"<br>';
$tt .= $article_info['accept_sn'].'<br>'; $tt .= $article_info['accept_sn'].'<br>';
$tt .= 'journal:'.$journal_info['title'].'<br><br>'; $tt .= 'journal:'.$journal_info['title'].'<br><br>';
$tt .= 'Dear '.($user_info['realname']==''?'Authors':$user_info['realname']).',<br>Please check the new status of your manuscript online.<br><br>'; $tt .= 'Dear '.($user_info['realname']==''?$user_info['account']:$user_info['realname']).',<br>Please check the new status of your manuscript online.<br><br>';
} }
$tt .= $journal_info['title'].'<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>'; $tt .= '<a href="https://www.tmrjournals.com/draw_up.html?issn='.$journal_info['issn'].'">Subscribe to this journal</a><br>';
@@ -819,6 +849,11 @@ class Article extends Controller {
$journal_info = $this->journal_obj->where('journal_id', $data['journal'])->find(); $journal_info = $this->journal_obj->where('journal_id', $data['journal'])->find();
//首先查重是否重复投稿
$checkArticle = $this->article_obj->where("title",trim($data['title']))->find();
if($checkArticle!=null){
return json(['code'=>1,'msg'=>'Warning: you re-submitting the article!']);
}
Db::startTrans(); Db::startTrans();
//添加文章基础信息 //添加文章基础信息
@@ -890,7 +925,7 @@ class Article extends Controller {
sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt,$journal_info['email'],$journal_info['epassword']); 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(); $user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id",$user_res['user_id'])->find();
//发送邮件给作者,表示感谢 //发送邮件给作者,表示感谢
$tt1 = 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_res['realname']==''?'Authors':$user_res['realname']).',<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']==''?$user_res['account']:$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>'; $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 期刊发送收到文章邮件 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>'; $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>';
@@ -990,7 +1025,7 @@ class Article extends Controller {
*/ */
public function getReviewerList() { public function getReviewerList() {
$data = $this->request->post(); $data = $this->request->post();
$limit_start = $data['pageIndex'] == 1 ? 0 : ($data['pageIndex'] - 1) * $data['pageSize'] - 1; $limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
$where['t_article_reviewer.article_id'] = $data['articleId']; $where['t_article_reviewer.article_id'] = $data['articleId'];
$res = $this->article_reviewer_obj->field('t_article_reviewer.*,t_user.email,t_user.account reviewer,t_user_reviewer_info.country country,t_user_reviewer_info.field,t_user_reviewer_info.company,t_reviewer_major.title major_title,t_reviewer_major.ctitle major_ctitle') $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', 't_article_reviewer.reviewer_id = t_user.user_id', 'LEFT')

View File

@@ -41,6 +41,79 @@ class Auto extends Controller {
$this->reviewer_info_obj = Db::name('user_reviewer_info'); $this->reviewer_info_obj = Db::name('user_reviewer_info');
} }
/**
* 推送邮件给审稿人提醒审稿人
*/
public function pushEmailForReviewer(){
//筛选数据
$list = $this->article_reviewer_obj->where("state","in",[0,5])->select();
foreach ($list as $v){
$cache_article = $this->article_obj->where("article_id",$v['article_id'])->find();
if($cache_article["state"]!=2){
continue;
}
$cache_t = intval((time()-$v["ctime"])/86400);
if($cache_t==14||$cache_t==21||$cache_t==28){
$cache_journal = $this->journal_obj->where("journal_id",$cache_article['journal_id'])->find();
//查找审稿人信息
$cache_reviewer = $this->user_obj
->join("t_user_reviewer_info","t_user_reviewer_info.reviewer_id = t_user.user_id","left")
->where("t_user.user_id",$v['reviewer_id'])->find();
$tt = "Manuscript ID: ".$cache_article['accept_sn']."<br>";
$tt .= "Title:".$cache_article['title']."<br>";
$tt .= "Dear ".($cache_reviewer['technical']==""||$cache_reviewer['technical']=="Others"?"Dr.":$cache_reviewer['technical'])." ".($cache_reviewer["realname"]==""?$cache_reviewer["account"]:$cache_reviewer["realname"])."<br><br>";
$tt .= "On ".date("d D Y",$v["ctime"])." we sent you a request to review a paper title ".$cache_article['title'].".<br><br>";
$tt .= "We have not yet received a response from you, possibly because the original invitation went astray. We would be grateful if you could let us know if you can carry out this review.<br><br>";
$tt .= "If you would like to review this paper, please click <a href='https://submission.tmrjournals.com/'>this link</a>.<br><br>";
$tt .= "If you do not wish to review this paper, please click <a href='http://api.tmrjournals.com/public/index.php/api/Reviewer/refusereview/aid/".$v['art_rev_id']."'>this link</a>.<br><br>";
$tt .= 'Sincerely,<br>Editorial Office<br>'.$cache_journal['title'].'<br>';
$tt .= 'Email: '.$cache_journal['email'].'<br>';
$tt .= 'Website:<a href="'.$cache_journal['website'].'">'.$cache_journal['website'].'</a>';
$maidata['email'] = $cache_reviewer['email'];
$maidata['title'] = "Invitation to review manuscript for ".$cache_journal['title']." - Reminder";
$maidata['content'] = $tt;
$maidata['tmail'] = $cache_journal['email'];
$maidata['tpassword'] = $cache_journal['epassword'];
Queue::push('app\api\job\mail@fire', $maidata, "tmail");
}
}
}
/**
* 推送邮件提醒作者修回稿件
*/
public function pushEmailForAuthor(){
//筛选数据
$list = $this->article_obj->where("state",4)->select();
foreach ($list as $v){
$cache_t = intval((time()-$v["ttime"])/86400);
if($cache_t==14||$cache_t==21||$cache_t==28){
//查找文章内容
$cache_journal = $this->journal_obj->where("journal_id",$v['journal_id'])->find();
//查找作者信息
$cache_author = $this->user_obj->where("user_id",$v['user_id'])->find();
$tt = "Dear Author,<br>";
$tt .= "We have send you the email about revision of your manuscript. According to our records you are almost reaching the deadline now. We look forward to receiving your revised article.<br><br>";
$tt .= "When preparing your revised manuscript, you are asked to carefully consider the reviewers' comments which are attached, and submit a revised versionand a list of responses to the comments before deadline. The revised parts in the manuscript should be highlighted with blue color.<br><br>";
$tt .= "If you feel that you will require more time to complete your revision, please let me know and I will update our records accordingly. If I can provide any further advice or assistance, please do not hesitate to contact me.<br><br><br>";
$tt .= 'Sincerely,<br>Editorial Office<br>'.$cache_journal['title'].'<br>';
$tt .= 'Email: '.$cache_journal['email'].'<br>';
$tt .= 'Website:<a href="'.$cache_journal['website'].'">'.$cache_journal['website'].'</a>';
$maidata['email'] = $cache_author['email'];
$maidata['title'] = "Deadline for your revision of ".$cache_journal['title']." -Reminder";
$maidata['content'] = $tt;
$maidata['tmail'] = $cache_journal['email'];
$maidata['tpassword'] = $cache_journal['epassword'];
Queue::push('app\api\job\mail@fire', $maidata, "tmail");
}
}
}
/** /**
* 自动审稿主方法 * 自动审稿主方法
*/ */

View File

@@ -718,7 +718,7 @@ class Chief extends Controller {
//发送邮件给编委,并创造直连链接 //发送邮件给编委,并创造直连链接
$tt = $article_info['accept_sn'].'<br>'; $tt = $article_info['accept_sn'].'<br>';
$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']).'<br>'; $tt .= 'Dear '.($board_rev_info==null||$board_rev_info['technical']=="Others"||$board_rev_info['technical']==""?"Dr.":$board_rev_info['technical']).($board_info['realname']==''?$board_info["account"]:$board_info['realname']).'<br>';
$tt .= 'The manuscript entitled “'.$article_info['title'].'”is under fininal decision status of the journal '.$journal_info['title'].'.<br>'; $tt .= 'The manuscript entitled “'.$article_info['title'].'”is under fininal decision status of the journal '.$journal_info['title'].'.<br>';
$tt .= '(The manuscripit in fininal decision status has been peer-reviewed, and the authors had revised all review opinions.)<br>'; $tt .= '(The manuscripit in fininal decision status has been peer-reviewed, and the authors had revised all review opinions.)<br>';
$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'].'.<br>'; $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'].'.<br>';

View File

@@ -0,0 +1,177 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace app\api\controller;
use think\Controller;
use think\Db;
use think\Queue;
/**
* @title 领域接口
* @description 领域接口
*/
class Major extends Controller{
protected $article_obj = '';
protected $user_obj = '';
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 = '';
protected $article_msg_obj = '';
protected $article_file_obj = '';
protected $article_reviewer_obj = '';
protected $article_author_obj = '';
protected $article_transfer_obj = '';
protected $chief_to_journal_obj = '';
protected $login_auto_obj = '';
protected $major_obj = "";
public function __construct(\think\Request $request = null) {
parent::__construct($request);
$this->user_obj = Db::name('user');
$this->user_act_obj = Db::name('user_act');
$this->article_obj = Db::name('article');
$this->journal_obj = Db::name('journal');
$this->user_log_obj = Db::name('user_log');
$this->user_reviewer_info_obj = Db::name("user_reviewer_info");
$this->reviewer_major_obj = Db::name('reviewer_major');
$this->reviewer_to_journal_obj = Db::name('reviewer_to_journal');
$this->article_reviewer_question_obj = Db::name('article_reviewer_question');
$this->article_msg_obj = Db::name('article_msg');
$this->article_file_obj = Db::name('article_file');
$this->article_reviewer_obj = Db::name('article_reviewer');
$this->article_author_obj = Db::name('article_author');
$this->article_transfer_obj = Db::name('article_transfer');
$this->chief_to_journal_obj = Db::name('chief_to_journal');
$this->login_auto_obj = Db::name('login_auto');
$this->major_obj = Db::name("major");
}
/**
* @title 添加领域
* @description 添加领域
* @author wangjinlei
* @url /api/Major/addMajor
* @method POST
*
* @param name:major_title type:string require:1 desc:领域名
* @param name:nickname type:string require:0 desc:别称
* @param name:major_sort type:int require:0 desc:权重
* @param name:pid type:int require:1 desc:父级id(0代表顶级)
*
*/
public function addMajor(){
$data = $this->request->post();
$insert['major_title'] = trim($data['major_title']);
$insert['pid'] = $data['pid'];
if(isset($data['nickname'])){
$insert['nickname'] = trim($data['nickname']);
}
if(isset($data['major_sort'])){
$insert['major_sort'] = $data['major_sort'];
}
if($data['pid']==0){
$insert['major_level'] = 1;
}else{
$p_major = $this->major_obj->where('major_id',$data['pid'])->find();
$insert['major_level'] = $p_major['major_level']+1;
}
$insert['major_ctime'] = time();
$this->major_obj->insert($insert);
return jsonSuccess([]);
}
/**
* @title 编辑领域
* @description 编辑领域
* @author wangjinlei
* @url /api/Major/editMajor
* @method POST
*
* @param name:major_id type:int require:1 desc:领域id
* @param name:major_title type:string require:1 desc:领域名
* @param name:nickname type:string require:0 desc:别称
* @param name:major_sort type:int require:0 desc:权重
*
*/
public function editMajor(){
$data = $this->request->post();
$update['major_title'] = trim($data['major_title']);
if(isset($data['nickname'])){
$update['nickname'] = trim($data['nickname']);
}
if(isset($data['major_sort'])){
$update['major_sort'] = $data['major_sort'];
}
$this->major_obj->where("major_id",$data['major_id'])->update($update);
return jsonSuccess([]);
}
/**
* @title 获取领域树
* @description 获取领域树
* @author wangjinlei
* @url /api/Major/getMajorList
* @method POST
*
* @return majors:领域树
*/
public function getMajorList(){
//查询顶级
$list = $this->major_obj->where('pid',0)->where('major_state',0)->order('major_sort desc')->select();
foreach ($list as $k => $v){
$cache_child = $this->getMajorChild($v);
if($cache_child!=null){
$list[$k]['children'] = $cache_child;
}
}
$re['majors'] = $list;
return jsonSuccess($re);
}
/**
* @title 添加期刊领域
* @description 添加期刊领域
* @author wangjinlei
* @url /api/Major/addJournalMajor
* @method POST
*
* @param name:major_id type:int require:1 desc:领域id
* @param name:jou $name Description
*
* @return majors:领域树
*/
public function addJournalMajor(){
}
/**
* 获取领域子树
*/
private function getMajorChild($major){
$list = $this->major_obj->where('pid',$major['major_id'])->where('major_state',0)->order("major_sort desc")->select();
if($list == null){
return null;
}
foreach ($list as $k => $v){
$cache_child = $this->getMajorChild($v);
if($cache_child!=null){
$list[$k]['children'] = $cache_child;
}
}
return $list;
}
}

View File

@@ -88,6 +88,7 @@ class Reviewer extends Controller {
->join('t_article', 't_article_reviewer.article_id = t_article.article_id', 'LEFT') ->join('t_article', 't_article_reviewer.article_id = t_article.article_id', 'LEFT')
->join('t_journal', 't_article.journal_id = t_journal.journal_id', 'LEFT') ->join('t_journal', 't_article.journal_id = t_journal.journal_id', 'LEFT')
->where('t_article_reviewer.reviewer_id', $reviewer_info['user_id']) ->where('t_article_reviewer.reviewer_id', $reviewer_info['user_id'])
->where("t_article.state",2)
->where('t_article_reviewer.state', 0) ->where('t_article_reviewer.state', 0)
->select(); ->select();
foreach ($res as $k => $v) { foreach ($res as $k => $v) {
@@ -124,7 +125,7 @@ class Reviewer extends Controller {
$data = $this->request->post(); $data = $this->request->post();
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize']; $limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
$reviewer_info = $this->user_obj->where('user_id', $data['user_id'])->find(); $reviewer_info = $this->user_obj->where('user_id', $data['user_id'])->find();
$res = $this->article_reviewer_obj->field('t_article_reviewer.*,t_article.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') $res = $this->article_reviewer_obj->field('t_article_reviewer.*,t_article.article_id,t_article.journal_id,t_article.major_id,t_article.abstrart,t_article.cmajor_id,t_article.state astate,t_article.title article_title,t_article.type,t_journal.title journal_title,t_article.accept_sn accept_sn')
->join('t_article', 't_article_reviewer.article_id = t_article.article_id', 'LEFT') ->join('t_article', 't_article_reviewer.article_id = t_article.article_id', 'LEFT')
->join('t_journal', 't_article.journal_id = t_journal.journal_id', 'LEFT') ->join('t_journal', 't_article.journal_id = t_journal.journal_id', 'LEFT')
->where('t_article_reviewer.reviewer_id', $reviewer_info['user_id']) ->where('t_article_reviewer.reviewer_id', $reviewer_info['user_id'])
@@ -365,7 +366,7 @@ class Reviewer extends Controller {
} }
//保存usermsg //保存usermsg
add_usermsg($type == 'editor'?$artrev_info['reviewer_id']:$article_info['editor_id'], 'New status of the manuscript', $user_msg_url); add_usermsg($type == 'editor' ? $artrev_info['reviewer_id'] : $journal_info['editor_id'], 'New status of the manuscript', $user_msg_url);
return json(['code' => 0]); return json(['code' => 0]);
} }
@@ -384,7 +385,6 @@ class Reviewer extends Controller {
return json($frag); return json($frag);
} }
/** /**
* @title 获取文章文件manuscirpt * @title 获取文章文件manuscirpt
* @description 获取文章文件manuscirpt * @description 获取文章文件manuscirpt
@@ -419,7 +419,6 @@ class Reviewer extends Controller {
return json(['data' => $file_list]); return json(['data' => $file_list]);
} }
/** /**
* @title 审稿人详情页--获取文章审稿实例详情(审稿人,编辑) * @title 审稿人详情页--获取文章审稿实例详情(审稿人,编辑)
* @description 审稿人详情页--获取文章审稿实例详情(审稿人,编辑) * @description 审稿人详情页--获取文章审稿实例详情(审稿人,编辑)
@@ -469,7 +468,10 @@ class Reviewer extends Controller {
$data = $this->request->post(); $data = $this->request->post();
$article_info = $this->article_obj->where('article_id', $data['articleId'])->find(); $article_info = $this->article_obj->where('article_id', $data['articleId'])->find();
$reviewer_info = $this->user_obj->where('user_id', $data['uid'])->find(); $reviewer_info = $this->user_obj
->join("t_user_reviewer_info","t_user_reviewer_info.reviewer_id = t_user.user_id","left")
->where('t_user.user_id', $data['uid'])
->find();
$journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find(); $journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find();
//增加信息到文章审稿表 //增加信息到文章审稿表
@@ -480,23 +482,24 @@ class Reviewer extends Controller {
$res = $this->article_reviewer_obj->insertGetId($insert_data); $res = $this->article_reviewer_obj->insertGetId($insert_data);
//发送email提醒审稿员 //发送email提醒审稿员
// $tt = $article_info['accept_sn'] . '<br>'; $tt = $article_info['accept_sn'] . '<br>';
// $tt .= 'Dear '.$reviewer_info['realname'].'<br><br>'; $tt .= 'Dear ' . ( $reviewer_info['technical'] == "Others" || $reviewer_info['technical'] == "" ? "Dr." : $reviewer_info['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' $tt .= 'The manuscript entitled “'.$article_info['title'].'” has'
// . ' be most grateful if you could offer an opinion regarding its suitability for publication' . ' been submitted to the journal '.$journal_info['title'].'. The Editor-in-Chief would'
// . ' in the journal '.$journal_info['title'].'. <br>'; . ' be most grateful if you could offer an opinion regarding its suitability for publication'
// $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>'; . ' in the journal '.$journal_info['title'].'. <br>';
// $tt .= 'Thank you for your consideration.<br> Look forward for your reply.<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 .= '<a href="'.$this->creatLoginUrlForreviewer($reviewer_info,$res).'">Click here to review the article</a><br>'; $tt .= 'Thank you for your consideration.<br> Look forward for your reply.<br>';
// $tt .= 'Your username:'.$reviewer_info['account'].'<br><br>'; $tt .= '<a href="'.$this->creatLoginUrlForreviewer($reviewer_info,$res).'">Click here to review the article</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 .= 'Your username:'.$reviewer_info['account'].'<br><br>';
// $tt .= 'Sincerely,<br>Editorial Office<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 .= '<a href="https://www.tmrjournals.com/draw_up.html?issn='.$journal_info['issn'].'">Subscribe to this journal</a><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>';
// $tt .= 'Email:'.$journal_info['email'].'<br>'; $tt .= $journal_info['title'].'<br>';
// $tt .= 'Website:'.$journal_info['website']; $tt .= 'Email:'.$journal_info['email'].'<br>';
// sendEmail($reviewer_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']); $tt .= 'Website:'.$journal_info['website'];
sendEmail($reviewer_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
return jsonSuccess([]); return jsonSuccess([]);
} }
@@ -654,7 +657,6 @@ class Reviewer extends Controller {
} }
//记录log //记录log
//生成pdf文件 //生成pdf文件
$reviewer_pdf = self::pdftest($journal_info['title']); $reviewer_pdf = self::pdftest($journal_info['title']);
@@ -689,7 +691,6 @@ class Reviewer extends Controller {
} }
} }
/** /**
* 上传文章的文件 * 上传文章的文件
*/ */
@@ -705,6 +706,31 @@ class Reviewer extends Controller {
} }
} }
/**
* @title 审稿人cv上传
* @description 审稿人cv上传
* @author wangjinlei
* @url /api/Reviewer/up_cv_file
* @method POST
*
* @param name:name type:string require:1 default:reviewerCV desc:文件域名称
*
* @return upurl:图片地址
*/
public function up_cv_file() {
$file = request()->file('reviewerCV');
if ($file) {
$info = $file->move(ROOT_PATH . 'public' . DS . 'reviewer');
if ($info) {
return json(['code' => 0, 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
} else {
return json(['code' => 1, 'msg' => $file->getError()]);
}
}
}
/** /**
* @title 待审文章页--获取待审文章列表 * @title 待审文章页--获取待审文章列表
* @description 待审文章页--获取待审文章列表 * @description 待审文章页--获取待审文章列表
@@ -849,7 +875,7 @@ class Reviewer extends Controller {
$res = $this->article_reviewer_obj->insertGetId($insert_data); $res = $this->article_reviewer_obj->insertGetId($insert_data);
//发送email提醒审稿员 //发送email提醒审稿员
$tt = $article_info['accept_sn'] . '<br>'; $tt = $article_info['accept_sn'] . '<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><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 .= 'The manuscript entitled “' . $article_info['title'] . '” has' $tt .= 'The manuscript entitled “' . $article_info['title'] . '” has'
. ' been submitted to the journal ' . $journal_info['title'] . '. The Editor-in-Chief would' . ' 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' . ' be most grateful if you could offer an opinion regarding its suitability for publication'
@@ -908,9 +934,30 @@ class Reviewer extends Controller {
$data = $this->request->post(); $data = $this->request->post();
$this->article_reviewer_obj->where('art_rev_id', $data['art_rev_id'])->update(['state' => 4]); $this->article_reviewer_obj->where('art_rev_id', $data['art_rev_id'])->update(['state' => 4]);
//记录审稿失败次数
$art_rev_info = $this->article_reviewer_obj->where('art_rev_id', $data['art_rev_id'])->find();
$this->user_obj->where("user_id",$art_rev_info["reviewer_id"])->setInc("rd_num");
return jsonSuccess([]); return jsonSuccess([]);
} }
/**
* 拒绝审稿get方法
*/
public function refusereview($aid){
$art_rev_info = $this->article_reviewer_obj->where('art_rev_id', $aid)->find();
if($art_rev_info==null){
return "error";
}
$this->article_reviewer_obj->where('art_rev_id', $aid)->update(['state' => 4]);
//记录审稿失败次数
$this->user_obj->where("user_id",$art_rev_info["reviewer_id"])->setInc("rd_num");
echo "You have declined the reviewing invitation.";
}
/** /**
* @title 获取邀请审稿实例列表 * @title 获取邀请审稿实例列表
* @description 获取邀请审稿实例列表 * @description 获取邀请审稿实例列表
@@ -1047,6 +1094,7 @@ class Reviewer extends Controller {
* @param name:orcid type:string require:0 desc:orcid * @param name:orcid type:string require:0 desc:orcid
* @param name:introduction type:string require:0 desc:简介 * @param name:introduction type:string require:0 desc:简介
* @param name:company type:string require:0 desc:单位 * @param name:company type:string require:0 desc:单位
* @param name:cv type:string require:1 desc:审稿人简历
*/ */
public function addReviewer() { public function addReviewer() {
$data = $this->request->post(); $data = $this->request->post();
@@ -1085,6 +1133,7 @@ class Reviewer extends Controller {
$info_insert['company'] = isset($data['company']) ? trim($data['company']) : ''; $info_insert['company'] = isset($data['company']) ? trim($data['company']) : '';
$info_insert['major'] = $data['major']; $info_insert['major'] = $data['major'];
$info_insert['cmajor'] = $data['cmajor']; $info_insert['cmajor'] = $data['cmajor'];
$info_insert['qualifications'] = trim($data['cv']);
$info_insert['field'] = trim($data['field']); $info_insert['field'] = trim($data['field']);
$res1 = $this->user_reviewer_info_obj->insertGetId($info_insert); $res1 = $this->user_reviewer_info_obj->insertGetId($info_insert);
$to_insert['reviewer_id'] = $uid; $to_insert['reviewer_id'] = $uid;
@@ -1097,16 +1146,16 @@ class Reviewer extends Controller {
if ($uid && $res1 && $res2) { if ($uid && $res1 && $res2) {
Db::commit(); Db::commit();
//发送邮件通知审稿人 //发送邮件通知审稿人
$content = "Please find your following username and original password. Editorial team thank you for your supprot.<br/>"; // $content = "Please find your following username and original password. Editorial team thank you for your supprot.<br/>";
$content .= '<a href="https://submission.tmrjournals.com">SubmissionSystem</a><br>'; // $content .= '<a href="https://submission.tmrjournals.com">SubmissionSystem</a><br>';
$content .= '<p>username:' . trim($data['account']) . '</p>'; // $content .= '<p>username:' . trim($data['account']) . '</p>';
$content .= '<p>Original Password: 123456qwe</p>'; // $content .= '<p>Original Password: 123456qwe</p>';
$maidata['email'] = trim($data['email']); // $maidata['email'] = trim($data['email']);
$maidata['title'] = $journal_info['title']; // $maidata['title'] = $journal_info['title'];
$maidata['content'] = $content; // $maidata['content'] = $content;
$maidata['tmail'] = $journal_info['email']; // $maidata['tmail'] = $journal_info['email'];
$maidata['tpassword'] = $journal_info['epassword']; // $maidata['tpassword'] = $journal_info['epassword'];
Queue::push( 'app\api\job\mail@fire' , $maidata , "tmail" ); // Queue::push('app\api\job\mail@fire', $maidata, "tmail");
return jsonSuccess([]); return jsonSuccess([]);
} else { } else {
Db::rollback(); Db::rollback();
@@ -1131,6 +1180,7 @@ class Reviewer extends Controller {
* @param name:field type:string require:1 desc:领域 * @param name:field type:string require:1 desc:领域
* @param name:introduction type:string require:0 desc:简介 * @param name:introduction type:string require:0 desc:简介
* @param name:company type:string require:0 desc:单位 * @param name:company type:string require:0 desc:单位
* @param name:cv type:string require:1 desc:审稿人简历
*/ */
public function addReviewerBee() { public function addReviewerBee() {
$data = $this->request->post(); $data = $this->request->post();
@@ -1150,6 +1200,7 @@ class Reviewer extends Controller {
$info_insert['major'] = $data['major']; $info_insert['major'] = $data['major'];
$info_insert['cmajor'] = $data['cmajor']; $info_insert['cmajor'] = $data['cmajor'];
$info_insert['field'] = trim($data['field']); $info_insert['field'] = trim($data['field']);
$info_insert['qualifications'] = trim($data['cv']);
if ($reviewer_info != null) { if ($reviewer_info != null) {
$this->user_reviewer_info_obj->insertGetId($info_insert); $this->user_reviewer_info_obj->insertGetId($info_insert);
} else { } else {
@@ -1166,6 +1217,36 @@ class Reviewer extends Controller {
return jsonSuccess([]); return jsonSuccess([]);
} }
/**
* @title 编辑审稿人信息(编辑)
* @description 编辑审稿人信息(编辑)
* @author wangjinlei
* @url /api/Reviewer/editReviewerForEditor
* @method POST
*
* @param name:user_id type:int require:1 desc:用户id
* @param name:title type:string require:1 desc:用户title
* @param name:major type:int require:1 desc:领域
* @param name:cmajor type:int require:1 desc:子领域
* @param name:field type:string require:1 desc:领域
* @param name:introduction type:string require:0 desc:简介
* @param name:company type:string require:0 desc:单位
* @param name:cv type:string require:1 desc:审稿人简历
*/
public function editReviewerForEditor(){
$data = $this->request->post();
// $info_insert['reviewer_id'] = $data['user_id'];
$info_insert['technical'] = $data['title'];
$info_insert['introduction'] = isset($data['introduction']) ? trim($data['introduction']) : '';
$info_insert['company'] = isset($data['company']) ? trim($data['company']) : '';
$info_insert['major'] = $data['major'];
$info_insert['cmajor'] = $data['cmajor'];
$info_insert['field'] = trim($data['field']);
$info_insert['qualifications'] = trim($data['cv']);
$this->user_reviewer_info_obj->where("reviewer_id",$data['user_id'])->update($info_insert);
return jsonSuccess([]);
}
/** /**
* @title 获取审稿人列表 * @title 获取审稿人列表
* @description 获取审稿人列表 * @description 获取审稿人列表
@@ -1216,6 +1297,173 @@ class Reviewer extends Controller {
return json($re); return json($re);
} }
/**
* @title 获取期刊审稿人范围内全部领域
* @description 获取期刊审稿人范围内全部领域
* @author wangjinlei
* @url /api/Reviewer/getAllReviewerMajor
* @method POST
*
* @param name:article_id type:int require:1 desc:文章id
*
* @return majors:领域列表#
*/
public function getAllReviewerMajor() {
$data = $this->request->post();
$article_info = $this->article_obj->where("article_id", $data['article_id'])->find();
$ids = $this->reviewer_to_journal_obj
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
->where("t_reviewer_to_journal.state", 0)
->column("t_user_reviewer_info.major");
$list = $this->reviewer_major_obj->where("major_id", "in",$ids)->where("state", 0)->select();
foreach ($list as $k => $v) {
$list[$k]["children"] = $this->reviewer_major_obj->where("pid", $v["major_id"])->where("state", 0)->select();
}
$re['majors'] = $list;
return jsonSuccess($re);
}
/**
* @title 查找条件下的审稿人
* @description 查找条件下的审稿人
* @author wangjinlei
* @url /api/Reviewer/searchReviewer
* @method POST
*
* @param name:article_id type:int require:1 desc:文章id
* @param name:major_id type:int require:1 desc:领域id
* @param name:keywords type:string require:1 desc:关键词
* @param name:pageIndex type:int require:1 desc:当前页码数
* @param name:pageSize type:int require:1 desc:单页数据条数
*
* @return reviewers:审稿人列表#
*/
public function searchReviewer() {
$data = $this->request->post();
$article_info = $this->article_obj->where("article_id", $data['article_id'])->find();
$noids = $this->article_reviewer_obj->where('article_id', $data['article_id'])->column('reviewer_id');
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
$list = [];
$count = 0;
if ($data["keywords"] == "") {
if ($data["major_id"] == 0) {
$list = $this->reviewer_to_journal_obj
->field("t_user.user_id,t_user.realname,t_reviewer_major.title cmajor,t_user.account,t_user_reviewer_info.company,t_user_reviewer_info.field,t_user.rs_num,t_user.rd_num")
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_reviewer_major","t_reviewer_major.major_id = t_user_reviewer_info.cmajor","left")
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
->where('t_reviewer_to_journal.state', 0)
->order("t_user.rs_num desc")
->limit($limit_start, $data['pageSize'])
->select();
$count = $this->reviewer_to_journal_obj
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
->where('t_reviewer_to_journal.state', 0)
->count();
} else {
$list = $this->reviewer_to_journal_obj
->field("t_user.user_id,t_user.realname,t_reviewer_major.title cmajor,t_user.account,t_user_reviewer_info.company,t_user_reviewer_info.field,t_user.rs_num,t_user.rd_num")
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_reviewer_major","t_reviewer_major.major_id = t_user_reviewer_info.cmajor","left")
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
->where("t_user_reviewer_info.major", $data['major_id'])
->where('t_reviewer_to_journal.state', 0)
->order("t_user.rs_num desc")
->limit($limit_start, $data['pageSize'])
->select();
$count = $this->reviewer_to_journal_obj
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
->where("t_user_reviewer_info.major", $data['major_id'])
->where('t_reviewer_to_journal.state', 0)
->count();
}
} else {
if ($data["major_id"] == 0) {
$list = $this->reviewer_to_journal_obj
->field("t_user.user_id,t_user.realname,t_reviewer_major.title cmajor,t_user.account,t_user_reviewer_info.company,t_user_reviewer_info.field,t_user.rs_num,t_user.rd_num")
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_reviewer_major","t_reviewer_major.major_id = t_user_reviewer_info.cmajor","left")
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
->where("t_user_reviewer_info.introduction|t_user_reviewer_info.field|t_user.account", "like", "%" . $data["keywords"] . "%")
->where('t_reviewer_to_journal.state', 0)
->order("t_user.rs_num desc")
->limit($limit_start, $data['pageSize'])
->select();
$count = $this->reviewer_to_journal_obj
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
->where("t_user_reviewer_info.introduction|t_user_reviewer_info.field|t_user.account", "like", "%" . $data["keywords"] . "%")
->where('t_reviewer_to_journal.state', 0)
->count();
} else {
$list = $this->reviewer_to_journal_obj
->field("t_user.user_id,t_user.realname,t_reviewer_major.title cmajor,t_user.account,t_user_reviewer_info.company,t_user_reviewer_info.field,t_user.rs_num,t_user.rd_num")
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_reviewer_major","t_reviewer_major.major_id = t_user_reviewer_info.cmajor","left")
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
->where("t_user_reviewer_info.major", $data['major_id'])
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
->where("t_user_reviewer_info.introduction|t_user_reviewer_info.field|t_user.account", "like", "%" . $data["keywords"] . "%")
->where('t_reviewer_to_journal.state', 0)
->order("t_user.rs_num desc")
->limit($limit_start, $data['pageSize'])
->select();
$count = $this->reviewer_to_journal_obj
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
->where("t_user_reviewer_info.major", $data['major_id'])
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
->where("t_user_reviewer_info.introduction|t_user_reviewer_info.field|t_user.account", "like", "%" . $data["keywords"] . "%")
->where('t_reviewer_to_journal.state', 0)
->count();
}
}
$re['reviewers'] = $list;
$re['count'] = $count;
return jsonSuccess($re);
}
/**
* @title 获取所有审稿意见
* @description 获取所有审稿意见
* @author wangjinlei
* @url /api/Reviewer/getAllReviewerObj
* @method POST
*
* @param name:article_id type:int require:1 desc:文章id
*
* @return reviews:审稿列表#
*/
public function getAllReviewerObj() {
$data = $this->request->post();
$list = $this->article_reviewer_obj
->where("article_id",$data['article_id'])
->where("state","in",[2,3])
->select();
foreach ($list as $k => $v){
$list[$k]["question"] = $this->article_reviewer_question_obj->where("art_rev_id",$v['art_rev_id'])->find();
}
$re["reviews"] = $list;
return jsonSuccess($re);
}
/** /**
* 存储reviewer文件历史信息 * 存储reviewer文件历史信息
*/ */
@@ -1234,7 +1482,6 @@ class Reviewer extends Controller {
return $this->article_reviewer_file_obj->insert($insert_data); return $this->article_reviewer_file_obj->insert($insert_data);
} }
public function pdft() { public function pdft() {
$this->pdftest('I am wjl'); $this->pdftest('I am wjl');
} }

View File

@@ -53,6 +53,7 @@ class Super extends Controller{
$list[$k]['CC'] = $this->getCC($v['journal_id'],$start_time,$end_time); $list[$k]['CC'] = $this->getCC($v['journal_id'],$start_time,$end_time);
$list[$k]['WS'] = $this->getWS($v['journal_id'],$start_time,$end_time); $list[$k]['WS'] = $this->getWS($v['journal_id'],$start_time,$end_time);
$list[$k]['SJ'] = $this->getSJ($v['journal_id'],$start_time,$end_time); $list[$k]['SJ'] = $this->getSJ($v['journal_id'],$start_time,$end_time);
$list[$k]['JST'] = $this->getJST($v['journal_id'],$start_time,$end_time);
} }
return json($list); return json($list);
} }
@@ -131,6 +132,28 @@ class Super extends Controller{
return $all==0?0:$js/$all; return $all==0?0:$js/$all;
} }
private function getJST($journal_id,$start_time,$end_time){
$list = $this->article_obj->where("journal_id",$journal_id)
->where('rtime','>',$start_time)
->where('rtime','<=',$end_time)
->select();
$f = 0;
foreach ($list as $v){
$f += ($v['rtime']-$v["ctime"]);
}
$list1 = $this->article_obj->where("journal_id",$journal_id)
->where('rstime','>',$start_time)
->where('rstime','<=',$end_time)
->select();
foreach ($list1 as $v){
$f += ($v['rstime']-$v["ctime"]);
}
$frag = count($list)==0?0:intval(($f/(count($list) + count($list1)))/(24*60*60));
return $frag;
}
/** /**
* 获取查重异常 * 获取查重异常
*/ */

View File

@@ -58,7 +58,6 @@ class User extends Controller {
*/ */
public function checkLogin() { public function checkLogin() {
$data = $this->request->post(); $data = $this->request->post();
if($data['username']=='fariba'||$data['username']=='Mohammad Hossein'||$data['username']=='xiaoyueyue'||$data['username']=='sethlee000'||$data['username']=='yuanying9908'){ 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.']); return json(['code'=>1,'msg'=>'Your account has been blocked. Please contact the publisher for details: publisher@tmrjournals.com.']);
} }
@@ -292,7 +291,7 @@ class User extends Controller {
$tt .= "Username:$account<br>"; $tt .= "Username:$account<br>";
$tt .= "Password:" . $data['password'] . '<br><br>'; $tt .= "Password:" . $data['password'] . '<br><br>';
$tt .= "Many thanks<br>TMR Publishing Group"; $tt .= "Many thanks<br>TMR Publishing Group";
sendEmail($email, 'Dear ' . $data['name'], 'TMR', $tt); sendEmail($email, 'Dear ' . $data['name'], 'TMR', $tt,);
return json($inser_data); return json($inser_data);
} }
@@ -371,7 +370,7 @@ class User extends Controller {
$url = config('base_web_url') . 'retrieveact?actkey=' . $act_insert['act_key']; $url = config('base_web_url') . 'retrieveact?actkey=' . $act_insert['act_key'];
$title = 'Your request to reset your password [TMR Publishing Group]'; $title = 'Your request to reset your password [TMR Publishing Group]';
$content = "$realname, we've received your request to reset your password.Please click the link below to change your password. <a href='$url' target='_blank'>$url</a>"; $content = "$realname, we've received your request to reset your password.Please click the link below to change your password. <a href='$url' target='_blank'>$url</a>";
$res = sendEmail($email, $title, 'TMR', $content); $res = sendEmail($email, $title, 'TMR', $content,);
if ($res['status'] == 1) {//成功 if ($res['status'] == 1) {//成功
return json(['code' => 0, 'msg' => 'success']); return json(['code' => 0, 'msg' => 'success']);
} else {//失败 } else {//失败