diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php
index 5c9a2bd..a3aa6f9 100644
--- a/application/api/controller/Article.php
+++ b/application/api/controller/Article.php
@@ -460,16 +460,9 @@ class Article extends Controller {
$transfer_list = $this->article_transfer_obj->where('article_id',$data['articleId'])->where('state',0)->select();
$user_info = $this->user_obj->where(['user_id' => $article_info['user_id']])->find();
$user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id",$user_info['user_id'])->find();
-// $sn_content = '';//显示接收sn信息
-//
-// //接受文章时,生成流水号
-// if ($article_info['state'] == 0 && $data['state'] == 1) {
-// $update_data['accept_sn'] = getArticleSN($journal_info['abbr'],$article_info['type']);
-// $sn_content .= 'your Manuscript ID: '.$update_data['accept_sn'].' ';
-// }
- if($data['state']==3 && count($transfer_list)>0){
+ if($data['state']==3 && count($transfer_list)>0){//拒绝转投
//查询转投期刊信息
$transfer_journal = $this->journal_obj->where('journal_id',$transfer_list[0]['journal_id'])->find();
//转投
@@ -514,17 +507,6 @@ class Article extends Controller {
return json(['code'=>0]);
}else{
- //添加文章状态信息(如果状态未更新可做通话用,并结束操作)
- $insert_data['article_id'] = $data['articleId'];
- $insert_data['content'] = $data['editormsg'];
- $insert_data['state_from'] = $article_info['state'];
- $insert_data['state_to'] = $data['state'];
- $insert_data['ctime'] = time();
- $this->article_msg_obj->insert($insert_data);
- if ($article_info['state'] == $data['state']) {
- $this->article_obj->where($where_article)->update(['editor_act'=>1]);
- return json(['code' => 0]);
- }
//接收文章,必须有两个及以上的大于40个字的对作者的评论,除去news和comment类型的文章
if($data['state']==5&&$article_info['type']!="N"&&$article_info['type']!="T"){
//定义符合条件的数量
@@ -537,12 +519,13 @@ class Article extends Controller {
->where('t_article_reviewer.state','in',[1,3])
->select();
foreach ($rev_list as $v){
- if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $v['comments'])>0){//含有中文
- if(mb_strlen($v['comments'], 'UTF8')>=60){
+ $content = $v['qu9_contents']." ".$v['qu10_contents']." ".$v['qu11_contents']." ".$v['qu12_contents']." ".$v['qu13_contents']." ".$v['qu14_contents']." ".$v['qu15_contents']." ".$v['comments'];
+ if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $content)>0){//含有中文
+ if(mb_strlen($content, 'UTF8')>=60){
$rev_real_num++;
}
}else{//不含中文
- $carray = explode(" ", $v['comments']);
+ $carray = explode(" ", $content);
if(count($carray)>=40){
$rev_real_num++;
}
@@ -552,6 +535,18 @@ class Article extends Controller {
return json(['code'=>1,'msg'=>"More than two available reviewer-comments are necessary before going next step."]);
}
}
+
+ //添加文章状态信息(如果状态未更新可做通话用,并结束操作)
+ $insert_data['article_id'] = $data['articleId'];
+ $insert_data['content'] = $data['editormsg'];
+ $insert_data['state_from'] = $article_info['state'];
+ $insert_data['state_to'] = $data['state'];
+ $insert_data['ctime'] = time();
+ $this->article_msg_obj->insert($insert_data);
+ if ($article_info['state'] == $data['state']) {
+ $this->article_obj->where($where_article)->update(['editor_act'=>1]);
+ return json(['code' => 0]);
+ }
$update_data['state'] = $data['state'];
$update_data['editor_act'] = 1;
//更新文章状态
@@ -861,7 +856,7 @@ class Article extends Controller {
$tt .= $journal_info['title'].'
';
$tt .= 'Email:'.$journal_info['email'].'
';
$tt .= 'Website:'.$journal_info['website'];
-// sendEmail($reviewer_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
+ sendEmail($reviewer_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
//记录userlog
$log_data['user_id'] = $article_info['editor_id'];
@@ -1060,6 +1055,9 @@ class Article extends Controller {
//增加usermsg
$res_msg = add_usermsg($journal_info['editor_id'], 'New manuscript', '/articleDetailEditor?id=' . $res);
+
+ //通讯作者转为审稿人
+ $this->addReviewerFromArticle($res, $journal_info['journal_id']);
if ($res && $res_author && $transr && $res_file1 && $res_file2 && $res_file3 && $res_file4 && $res_log && $res_msg) {
Db::commit();
@@ -1070,6 +1068,28 @@ class Article extends Controller {
}
}
+
+
+// public function cfreviewer(){
+// $list = $this->article_author_obj->where("is_report",1)->select();
+// foreach ($list as $v){
+// $ar = $this->article_obj->where("article_id",$v['article_id'])->find();
+// if(!$ar){
+// continue;
+// }
+// $this->addReviewerFromReportAuthor($v['art_aut_id'], $ar['journal_id']);
+// }
+// echo 'ok';
+// }
+
+
+ private function addReviewerFromArticle($article_id,$journal_id){
+ $list = $this->article_author_obj->where('article_id',$article_id)->where('is_report',1)->where('state',0)->select();
+ foreach ($list as $v){
+ $this->addReviewerFromReportAuthor($v['art_aut_id'], $journal_id);
+ }
+ }
+
/**
* 添加审稿人来自通讯作者
*/
@@ -1080,6 +1100,12 @@ class Article extends Controller {
if(!preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/",$author_info['email'])){
return ;
}
+
+ $check = $this->reviewer_from_author_obj->where('art_aut_id',$art_aut_id)->where('journal_id',$journal_id)->find();
+ if($check){
+ return ;
+ }
+
//判断目前的状态进行下一步流程
$user_info = $this->user_obj->where('email',$author_info['email'])->where('state',0)->find();
if($user_info==null){//不存在用户
diff --git a/application/api/controller/Auto.php b/application/api/controller/Auto.php
index d2e1b2f..2aff4b7 100644
--- a/application/api/controller/Auto.php
+++ b/application/api/controller/Auto.php
@@ -116,7 +116,7 @@ class Auto extends Controller {
$tt .= 'Website:' . $cache_journal['website'] . '';
$maidata['email'] = $cache_author['email'];
- $maidata['title'] = "Deadline for your revision of " . $cache_journal['title'] . " -Reminder";
+ $maidata['title'] = "Revision Due Date-" . $cache_journal['title'];
$maidata['content'] = $tt;
$maidata['tmail'] = $cache_journal['email'];
$maidata['tpassword'] = $cache_journal['epassword'];
diff --git a/application/api/controller/Reviewer.php b/application/api/controller/Reviewer.php
index 6a632f5..6928358 100644
--- a/application/api/controller/Reviewer.php
+++ b/application/api/controller/Reviewer.php
@@ -137,12 +137,15 @@ class Reviewer extends Controller {
$data = $this->request->post();
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
$reviewer_info = $this->user_obj->where('user_id', $data['user_id'])->find();
- $res = $this->article_reviewer_obj->field('t_article_reviewer.*,t_article.article_id,t_article.journal_id,t_article.major_id,t_article.abstrart,t_article.cmajor_id,t_article.state astate,t_article.title article_title,t_article.type,t_journal.title journal_title,t_article.accept_sn accept_sn')
+ $res = $this->article_reviewer_obj
+ ->field('t_article_reviewer.*,t_article.article_id,t_article.journal_id,t_article.major_id,t_article.abstrart,t_article.cmajor_id,t_article.state astate,t_article.title article_title,t_article.type,t_journal.title journal_title,t_article.accept_sn accept_sn,t_article_reviewer_question.recommend,t_article_reviewer_question.ctime recommenttime')
->join('t_article', 't_article_reviewer.article_id = t_article.article_id', 'LEFT')
->join('t_journal', 't_article.journal_id = t_journal.journal_id', 'LEFT')
+ ->join("t_article_reviewer_question","t_article_reviewer_question.art_rev_id = t_article_reviewer.art_rev_id","left")
->where('t_article_reviewer.reviewer_id', $reviewer_info['user_id'])
->where('t_article_reviewer.state', 'in', [1, 2, 3, 4])
- ->order('t_article_reviewer.state')
+ ->where("t_article.article_id",">",0)
+// ->order('t_article_reviewer.state')
->limit($limit_start, $data['pageSize'])
->select();
foreach ($res as $k => $v) {
@@ -159,7 +162,7 @@ class Reviewer extends Controller {
$res[$k]['cmajor'] = $cmajor['title'];
}
- $count = $this->article_reviewer_obj->where('reviewer_id', $reviewer_info['user_id'])->where('state', 'in', [1, 2, 3, 4])->count();
+ $count = $this->article_reviewer_obj->join('t_article', 't_article_reviewer.article_id = t_article.article_id', 'LEFT')->where('t_article_reviewer.reviewer_id', $reviewer_info['user_id'])->where('t_article_reviewer.state', 'in', [1, 2, 3, 4])->where("t_article.article_id",">",0)->count();
$re['lists'] = $res;
$re['count'] = $count;
return jsonSuccess($re);
@@ -677,13 +680,13 @@ class Reviewer extends Controller {
$tt = 'Dear editor,
';
$tt .= 'Please check the new comments from the reviewer.
';
$tt .= 'Journal:' . $journal_info['title'] . ' and article title:' . $article_info['title'];
-// sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
+ sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
//发送email感谢reviewer并携带附件
$reviewer_info = $this->user_obj->where('user_id', $art_rev_info['reviewer_id'])->find();
$tt1 = 'You have reviewed 1 submission in the journal ' . $journal_info['title'] . ' during ' . date('Y') . '.Thank you for your support to our journal. This contribution is greatly appreciated.
';
$tt1 .= 'Regards
Editorial Office
' . $journal_info['title'] . '
';
$tt1 .= 'Contact us
TMR Publishing Group Address: 11 Cockle Bay Rd, Cockle Bay, Auckland 2014, New Zealand
Telephone: +64 02108293806
E-mail: publisher@tmrjournals.com';
-// sendEmail($reviewer_info['email'], 'Your contribution is greatly appreciated', $journal_info['title'], $tt1, $journal_info['email'], $journal_info['epassword'], $reviewer_ZS);
+ sendEmail($reviewer_info['email'], 'Your contribution is greatly appreciated', $journal_info['title'], $tt1, $journal_info['email'], $journal_info['epassword'], $reviewer_ZS);
//记录usermsg
add_usermsg($journal_info['editor_id'], 'Feedback questionnaire be uploaded.', '/articleReviewerDetail?id=' . $data['art_rev_id']);
@@ -905,7 +908,7 @@ class Reviewer extends Controller {
$tt .= $journal_info['title'] . '
';
$tt .= 'Email:' . $journal_info['email'] . '
';
$tt .= 'Website:' . $journal_info['website'];
-// sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
+ sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
$re['art_rev_id'] = $res;
return jsonSuccess($re);
@@ -1306,6 +1309,25 @@ class Reviewer extends Controller {
$this->user_reviewer_info_obj->where("reviewer_id", $data['user_id'])->update($info_insert);
return jsonSuccess([]);
}
+
+
+// public function addtest(){
+// $list = $this->reviewer_to_journal_obj
+// ->field("t_reviewer_to_journal.*,t_user_reviewer_info.reviewer_info_id")
+// ->join("t_user_reviewer_info","t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id","left")
+// ->where("t_reviewer_to_journal.state",0)
+// ->select();
+// echo '
';
+//
+// foreach ($list as $v){
+// if($v['reviewer_info_id']!=null){
+// continue;
+// }
+// var_dump($v);
+// }
+//
+// echo '';
+// }
/**
* @title 获取审稿人列表
@@ -1531,10 +1553,11 @@ class Reviewer extends Controller {
$data = $this->request->post();
$list = $this->article_reviewer_obj
->where("article_id", $data['article_id'])
- ->where("state", "in", [2, 3])
+ ->where("state", "in", [1, 2, 3])
->select();
foreach ($list as $k => $v) {
$list[$k]["question"] = $this->article_reviewer_question_obj->where("art_rev_id", $v['art_rev_id'])->find();
+ $list[$k]['reviewer'] = $this->user_obj->where("user_id",$v['reviewer_id'])->find();
}
$re["reviews"] = $list;
diff --git a/application/api/controller/User.php b/application/api/controller/User.php
index 888a75d..30cb458 100644
--- a/application/api/controller/User.php
+++ b/application/api/controller/User.php
@@ -26,6 +26,8 @@ class User extends Controller {
protected $user_msg_obj = '';
protected $chief_to_journal_obj = '';
protected $board_to_journal_obj = '';
+ protected $reviewer_from_author_obj = '';
+ protected $article_author_obj = '';
public function __construct(\think\Request $request = null) {
parent::__construct($request);
@@ -41,6 +43,8 @@ class User extends Controller {
$this->user_msg_obj = Db::name('user_msg');
$this->chief_to_journal_obj = Db::name('chief_to_journal');
$this->board_to_journal_obj = Db::name('board_to_journal');
+ $this->reviewer_from_author_obj = Db::name('reviewer_from_author');
+ $this->article_author_obj = Db::name('article_author');
}
/**
@@ -336,7 +340,7 @@ class User extends Controller {
$tt .= "Username:$account