From b1b470496421989a420088c22aa6293fd01c2f4e Mon Sep 17 00:00:00 2001
From: wangjinlei <751475802@qq.com>
Date: Sun, 29 Jan 2023 17:41:11 +0800
Subject: [PATCH] 1
---
application/api/controller/Article.php | 2190 +++++++++++++--------
application/api/controller/Auto.php | 29 +-
application/api/controller/Production.php | 101 +-
application/api/controller/Reviewer.php | 16 +-
application/api/controller/Special.php | 35 +-
application/api/job/ts.php | 2 +-
application/common.php | 6 +-
7 files changed, 1497 insertions(+), 882 deletions(-)
diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php
index 3b3e61e..f7bb71a 100644
--- a/application/api/controller/Article.php
+++ b/application/api/controller/Article.php
@@ -11,7 +11,8 @@ use think\Validate;
* @title 文章接口
* @description 文章接口
*/
-class Article extends Controller {
+class Article extends Controller
+{
protected $article_obj = '';
protected $country_obj = '';
@@ -43,7 +44,8 @@ class Article extends Controller {
protected $production_article_obj = '';
protected $company_top_obj = '';
- public function __construct(\think\Request $request = null) {
+ public function __construct(\think\Request $request = null)
+ {
parent::__construct($request);
$this->user_obj = Db::name('user');
$this->country_obj = Db::name('country');
@@ -79,7 +81,7 @@ class Article extends Controller {
/**
* 获取文章列表(作者)
*/
-
+
/**
* @title 获取文章列表(作者)
* @description 获取文章列表(作者)
@@ -103,17 +105,19 @@ class Article extends Controller {
* @return major:领域信息#
*
*/
- public function getArticle() {
-
+ public function getArticle()
+ {
+
//接收参数
$data = $this->request->post();
//构造查询条件
$userres = $this->user_obj->where(['account' => $data['username']])->column('user_id');
$where['user_id'] = $userres[0];
+ $where['t_article.state'] = ['>', -1];
if ($data['journal'] != 0) {
$where['t_article.journal_id'] = $data['journal'];
}
- if($data['state'] != 0){
+ if ($data['state'] != 0) {
$where['t_article.state'] = $data['state'];
}
if ($data['name'] != '') {
@@ -123,20 +127,20 @@ class Article extends Controller {
//分页查询数据
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
$res = $this->article_obj->field('t_article.*,t_journal.title journalname')
- ->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'LEFT')
- ->where($where)
- ->order('article_id desc')
- ->limit($limit_start, $data['pageSize'])->select();
+ ->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'LEFT')
+ ->where($where)
+ ->order('article_id desc')
+ ->limit($limit_start, $data['pageSize'])->select();
$count = $this->article_obj->where($where)->count();
foreach ($res as $key => $val) {
//查询建议转投详情
$transfer_info = $this->article_transfer_obj
- ->field('t_article_transfer.*,t_journal.title jourtitle')
- ->join('t_journal', 't_journal.journal_id = t_article_transfer.journal_id', 'LEFT')
- ->where('t_article_transfer.article_id', $val['article_id'])
- ->where('t_article_transfer.state', 2)
- ->find();
+ ->field('t_article_transfer.*,t_journal.title jourtitle')
+ ->join('t_journal', 't_journal.journal_id = t_article_transfer.journal_id', 'LEFT')
+ ->where('t_article_transfer.article_id', $val['article_id'])
+ ->where('t_article_transfer.state', 2)
+ ->find();
$res[$key]['transinfo'] = $transfer_info;
//查询作者信息
@@ -144,12 +148,12 @@ class Article extends Controller {
//对于接受的文章查询后续状态
$proof_state = 0;
- if($val['state']==5){
+ if ($val['state'] == 5) {
proofState($val['article_id']);
- $p_info = $this->production_article_obj->where('article_id',$val['article_id'])->where('state',0)->find();
- if($p_info&&$p_info['proof_state']==1){
+ $p_info = $this->production_article_obj->where('article_id', $val['article_id'])->where('state', 0)->find();
+ if ($p_info && $p_info['proof_state'] == 1) {
$proof_state = 1;
- $res[$key]['state']=7;
+ $res[$key]['state'] = 7;
}
}
$res[$key]['proof'] = $proof_state;
@@ -168,7 +172,7 @@ class Article extends Controller {
// if(!$rule->check($data)){
// return jsonError($rule->getError());
// }
-
+
@@ -193,56 +197,57 @@ class Article extends Controller {
* @return articles:文章列表#
* @return count:总数#
*/
- public function getArticleForEditor() {
+ public function getArticleForEditor()
+ {
//接受参数
$data = $this->request->post();
//构造查询条件
- if ($data['journal'] == 0) {//全部期刊
+ if ($data['journal'] == 0) { //全部期刊
$userres = $this->user_obj->where(['account' => $data['username']])->column('user_id');
$journal_list = $this->journal_obj->where(['editor_id' => $userres[0]])->column('journal_id');
$where['t_article.journal_id'] = ['in', $journal_list];
} else {
$where['t_article.journal_id'] = $data['journal'];
}
- if($data['state'] >= 0){
+ if ($data['state'] >= 0) {
$where['t_article.state'] = $data['state'];
- }else{
- if($data['act']==1){
- $where['t_article.state'] = array('in',[0,1,2,4,6]);
- }else if($data['act']==2){
- $where['t_article.state'] = array('in',[3,5]);
+ } else {
+ if ($data['act'] == 1) {
+ $where['t_article.state'] = array('in', [0, 1, 2, 4, 6]);
+ } else if ($data['act'] == 2) {
+ $where['t_article.state'] = array('in', [3, 5]);
}
}
- if(isset($data['sn'])&& trim($data['sn'])!=""){
+ if (isset($data['sn']) && trim($data['sn']) != "") {
$where["t_article.accept_sn"] = trim($data['sn']);
}
if ($data['name'] != '') {
$where['t_article.title'] = array('like', "%" . $data['name'] . "%");
}
- if($data['special_num']!=0){
+ if ($data['special_num'] != 0) {
$where['t_article.special_num'] = $data['special_num'];
}
//分页查询数据
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
$res = $this->article_obj
- ->field('t_article.*,t_journal.title journalname,t_user.email,t_user.realname,t_user.phone')
- ->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'LEFT')
- ->join('t_user',"t_user.user_id = t_article.user_id",'left')
- ->where($where)
- ->order('t_article.article_id desc')
- ->limit($limit_start, $data['pageSize'])
- ->select();
- //增加审稿意见信息
- foreach($res as $key => $val){
- $cache_review = $this->article_reviewer_obj
- ->where("t_article_reviewer.article_id",$val['article_id'])
- ->where("t_article_reviewer.state",'in',[1,2,3])
+ ->field('t_article.*,t_journal.title journalname,t_user.email,t_user.realname,t_user.phone')
+ ->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'LEFT')
+ ->join('t_user', "t_user.user_id = t_article.user_id", 'left')
+ ->where($where)
+ ->order('t_article.article_id desc')
+ ->limit($limit_start, $data['pageSize'])
->select();
+ //增加审稿意见信息
+ foreach ($res as $key => $val) {
+ $cache_review = $this->article_reviewer_obj
+ ->where("t_article_reviewer.article_id", $val['article_id'])
+ ->where("t_article_reviewer.state", 'in', [1, 2, 3])
+ ->select();
$res[$key]['review'] = $cache_review;
-
+
//查询作者信息
- $res[$key]['author'] = $this->article_author_obj->where('article_id',$val['article_id'])->where('state',0)->select();
+ $res[$key]['author'] = $this->article_author_obj->where('article_id', $val['article_id'])->where('state', 0)->select();
//查询H指数添加人信息
$res[$key]['H'] = $this->getHPerson($val['article_id']);
@@ -252,11 +257,11 @@ class Article extends Controller {
}
//添加国家信息
- foreach($res as $k => $v){
- $cache_author_list = $this->article_author_obj->where('article_id',$v['article_id'])->select();
+ foreach ($res as $k => $v) {
+ $cache_author_list = $this->article_author_obj->where('article_id', $v['article_id'])->select();
$cache_country = [];
- foreach($cache_author_list as $key => $val){
- if($val['country']!=''&&!in_array($val['country'],$cache_country)){
+ foreach ($cache_author_list as $key => $val) {
+ if ($val['country'] != '' && !in_array($val['country'], $cache_country)) {
$cache_country[] = $val['country'];
}
}
@@ -264,9 +269,9 @@ class Article extends Controller {
}
//增加邮件历史记录
- foreach($res as $k => $v){
- $cache = $this->email_log_obj->where('article_id',$v['article_id'])->where('is_success',1)->select();
- $res[$k]['emailh'] = $cache?1:0;
+ foreach ($res as $k => $v) {
+ $cache = $this->email_log_obj->where('article_id', $v['article_id'])->where('is_success', 1)->select();
+ $res[$k]['emailh'] = $cache ? 1 : 0;
}
$count = $this->article_obj->where($where)->count();
@@ -274,50 +279,53 @@ class Article extends Controller {
return json(['total' => $count, 'data' => $res]);
}
- private function getReportAuthors($article_id){
- $article_info = $this->article_obj->where('article_id',$article_id)->find();
- $authors = $this->article_author_obj->where('article_id',$article_id)->where('is_report',1)->where('state',0)->select();
- foreach($authors as $k => $v){
- $c_user = $this->user_obj->where('email',$v['email'])->find();
+ private function getReportAuthors($article_id)
+ {
+ $article_info = $this->article_obj->where('article_id', $article_id)->find();
+ $authors = $this->article_author_obj->where('article_id', $article_id)->where('is_report', 1)->where('state', 0)->select();
+ foreach ($authors as $k => $v) {
+ $c_user = $this->user_obj->where('email', $v['email'])->find();
$authors[$k]['author_account'] = $c_user;
}
return $authors;
}
- private function getHPerson($article_id){
- $article_info = $this->article_obj->where('article_id',$article_id)->find();
- $authors = $this->article_author_obj->where('article_id',$article_id)->where('is_report',1)->where('state',0)->select();
+ private function getHPerson($article_id)
+ {
+ $article_info = $this->article_obj->where('article_id', $article_id)->find();
+ $authors = $this->article_author_obj->where('article_id', $article_id)->where('is_report', 1)->where('state', 0)->select();
$user_id = $article_info['user_id'];
$g_index = 0;
- foreach($authors as $v){
- $c_user = $this->user_obj->where('email',$v['email'])->find();
- if($c_user['google_index']>=$g_index){
+ foreach ($authors as $v) {
+ $c_user = $this->user_obj->where('email', $v['email'])->find();
+ if ($c_user['google_index'] >= $g_index) {
$user_id = $c_user['user_id'];
$g_index = $c_user['google_index'];
}
}
- $user_info = $this->user_obj->where('user_id',$user_id)->find();
+ $user_info = $this->user_obj->where('user_id', $user_id)->find();
return $user_info;
}
/**
* 获取文章的用户详情
*/
- public function getArticleUserDetail(){
+ public function getArticleUserDetail()
+ {
$data = $this->request->post();
$rule = new Validate([
- 'article_id'=>'require'
+ 'article_id' => 'require'
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
- $user_info = $this->user_obj->where('user_id',$article_info['user_id'])->find();
+ $article_info = $this->article_obj->where('article_id', $data['article_id'])->find();
+ $user_info = $this->user_obj->where('user_id', $article_info['user_id'])->find();
$re['userDetail'] = $user_info;
return jsonSuccess($re);
}
-
+
/**
* @title 获取文章详情(作者,编辑)
* @description 获取文章详情(作者,编辑)
@@ -337,61 +345,62 @@ class Article extends Controller {
* @return major:领域信息#
*
*/
- public function getArticleDetail() {
+ public function getArticleDetail()
+ {
//接受参数
$data = $this->request->post();
-
+
//查询文章基础数据
$where['t_article.article_id'] = $data['articleId'];
$article_res = $this->article_obj->field('t_article.*,t_journal.title journalname,t_user.account')->join(array(['t_journal', 't_journal.journal_id = t_article.journal_id', 'LEFT'], ['t_user', 't_user.user_id = t_article.user_id', 'LEFT']))->where($where)->find();
//查询文章状态跟踪信息
- $article_msg = $this->article_msg_obj->where(['article_id' => $data['articleId']])->where('state',0)->select();
-
+ $article_msg = $this->article_msg_obj->where(['article_id' => $data['articleId']])->where('state', 0)->select();
+
$suggest = '';
//如果是退修状态,显示退休信息
-// if($article_res['state']==4){
-// $lastbean = end($article_msg);
-// $suggest = $lastbean['content'];
-// }
+ // if($article_res['state']==4){
+ // $lastbean = end($article_msg);
+ // $suggest = $lastbean['content'];
+ // }
//查询审稿人审稿建议
// if($article_res['state']==4){
- $suggest = $this->article_reviewer_obj->field('t_article_reviewer.*,t_article_reviewer_question.qu9_contents,t_article_reviewer_question.qu10_contents,t_article_reviewer_question.qu11_contents,t_article_reviewer_question.qu12_contents,t_article_reviewer_question.qu13_contents,t_article_reviewer_question.qu14_contents,t_article_reviewer_question.qu15_contents,t_article_reviewer_question.comments comments')
- ->join('t_article_reviewer_question','t_article_reviewer.art_rev_id=t_article_reviewer_question.art_rev_id','left')
- ->where('t_article_reviewer.state','<',4)
- ->where('t_article_reviewer.state','>',0)
- ->where('t_article_reviewer.article_id',$article_res['article_id'])
- ->select();
+ $suggest = $this->article_reviewer_obj->field('t_article_reviewer.*,t_article_reviewer_question.qu9_contents,t_article_reviewer_question.qu10_contents,t_article_reviewer_question.qu11_contents,t_article_reviewer_question.qu12_contents,t_article_reviewer_question.qu13_contents,t_article_reviewer_question.qu14_contents,t_article_reviewer_question.qu15_contents,t_article_reviewer_question.comments comments')
+ ->join('t_article_reviewer_question', 't_article_reviewer.art_rev_id=t_article_reviewer_question.art_rev_id', 'left')
+ ->where('t_article_reviewer.state', '<', 4)
+ ->where('t_article_reviewer.state', '>', 0)
+ ->where('t_article_reviewer.article_id', $article_res['article_id'])
+ ->select();
// }
-
+
//查询major信息
-// $major_data = [];
-// if($article_res['major_id']!=0){
-// $major_data['major'] = $this->reviewer_major_obj->where('major_id',$article_res['major_id'])->find();
-// }else{
-// $major_data['major'] = null;
-// }
-// if($article_res['cmajor_id']!=0){
-// $major_data['cmajor'] = $this->reviewer_major_obj->where('major_id',$article_res['cmajor_id'])->find();
-// }else{
-// $major_data['cmajor'] = null;
-// }
+ // $major_data = [];
+ // if($article_res['major_id']!=0){
+ // $major_data['major'] = $this->reviewer_major_obj->where('major_id',$article_res['major_id'])->find();
+ // }else{
+ // $major_data['major'] = null;
+ // }
+ // if($article_res['cmajor_id']!=0){
+ // $major_data['cmajor'] = $this->reviewer_major_obj->where('major_id',$article_res['cmajor_id'])->find();
+ // }else{
+ // $major_data['cmajor'] = null;
+ // }
//新领域查询
- $major = $this->getMajorStr($article_res['major_id'])==""?"":substr($this->getMajorStr($article_res['major_id']), 3);
+ $major = $this->getMajorStr($article_res['major_id']) == "" ? "" : substr($this->getMajorStr($article_res['major_id']), 3);
//查询文章作者信息
$author_res = $this->article_author_obj->where('article_id', $data['articleId'])->where('state', 0)->select();
-
+
//查询转投信息
- $transfer_res = $this->article_transfer_obj->where('article_id',$data['articleId'])->select();
-
+ $transfer_res = $this->article_transfer_obj->where('article_id', $data['articleId'])->select();
+
//查询建议转投详情
$transfer_info = $this->article_transfer_obj
- ->field('t_article_transfer.*,t_journal.title jourtitle')
- ->join('t_journal','t_journal.journal_id = t_article_transfer.journal_id','LEFT')
- ->where('t_article_transfer.article_id',$data['articleId'])
- ->where('t_article_transfer.state',2)
- ->find();
+ ->field('t_article_transfer.*,t_journal.title jourtitle')
+ ->join('t_journal', 't_journal.journal_id = t_article_transfer.journal_id', 'LEFT')
+ ->where('t_article_transfer.article_id', $data['articleId'])
+ ->where('t_article_transfer.state', 2)
+ ->find();
//更新文章操作记录状态
if ($data['human'] == 'editor') {
@@ -400,20 +409,21 @@ class Article extends Controller {
$up_data['editor_act'] = 0;
}
$this->article_obj->where('article_id', $data['articleId'])->update($up_data);
-
- return json(['article' => $article_res, 'msg' => $article_msg, 'authors' => $author_res,'suggest'=>$suggest,'transfer'=>$transfer_res,'transinfo'=>$transfer_info,'major'=>$major]);
+
+ return json(['article' => $article_res, 'msg' => $article_msg, 'authors' => $author_res, 'suggest' => $suggest, 'transfer' => $transfer_res, 'transinfo' => $transfer_info, 'major' => $major]);
}
-
- private function getMajorStr($major_id){
+
+ private function getMajorStr($major_id)
+ {
$frag = '';
- $major_info = $this->major_obj->where('major_id',$major_id)->find();
- if($major_info==null){
+ $major_info = $this->major_obj->where('major_id', $major_id)->find();
+ if ($major_info == null) {
return '';
}
- if($major_info['major_level']==1){
+ if ($major_info['major_level'] == 1) {
return '';
- }else{
- $frag = $this->getMajorStr($major_info['pid']).' > '.$major_info['major_title'];
+ } else {
+ $frag = $this->getMajorStr($major_info['pid']) . ' > ' . $major_info['major_title'];
}
return $frag;
}
@@ -422,51 +432,52 @@ class Article extends Controller {
/**
* 作者同意转投
*/
- public function trans_manu(){
+ public function trans_manu()
+ {
//接受参数
$data = $this->request->post();
- $article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
- $journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
- $editor_info = $this->user_obj->where('user_id',$journal_info['editor_id'])->find();
-
+ $article_info = $this->article_obj->where('article_id', $data['article_id'])->find();
+ $journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find();
+ $editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find();
+
//更新文章状态
- $this->article_obj->where('article_id',$data['article_id'])->update(['journal_id'=>$data['journal_id'],'editor_id'=>$journal_info['editor_id'],'author_act'=>1,'state'=>1]);
-
+ $this->article_obj->where('article_id', $data['article_id'])->update(['journal_id' => $data['journal_id'], 'editor_id' => $journal_info['editor_id'], 'author_act' => 1, 'state' => 1]);
+
//跟新转投表状态
- $this->article_transfer_obj->where('transfer_id',$data['transfer_id'])->update(['state'=>1]);
-
+ $this->article_transfer_obj->where('transfer_id', $data['transfer_id'])->update(['state' => 1]);
+
//添加文章状态信息
$insert_data['article_id'] = $data['article_id'];
- $insert_data['content'] = 'manuscript transfer to :'.$journal_info['title'];
+ $insert_data['content'] = 'manuscript transfer to :' . $journal_info['title'];
$insert_data['state_from'] = $article_info['state'];
$insert_data['state_to'] = 1;
$insert_data['ctime'] = time();
$this->article_msg_obj->insert($insert_data);
-
+
//发送邮件提醒编辑有新的转投稿件
$tt1 = 'Dear editor';
$tt1 .= 'Please check the new transfer manuscript in the submission system.';
- $sendUser=[
- 'title'=> $journal_info['title'], // 邮件标题
- 'content'=>$tt1,//邮件内容
- 'user_id'=>$journal_info['editor_id'], //收件人ID
- 'email'=>$editor_info['email'],// 收件人邮箱
- 'journal_id'=>$journal_info['journal_id'], // 期刊ID
- 'sendEmail'=>$journal_info['email'], // 期刊邮箱
- 'sendPassword'=>$journal_info['epassword'], // 期刊密码
- 'from_name'=>$journal_info['title']
+ $sendUser = [
+ 'title' => $journal_info['title'], // 邮件标题
+ 'content' => $tt1, //邮件内容
+ 'user_id' => $journal_info['editor_id'], //收件人ID
+ 'email' => $editor_info['email'], // 收件人邮箱
+ 'journal_id' => $journal_info['journal_id'], // 期刊ID
+ 'sendEmail' => $journal_info['email'], // 期刊邮箱
+ 'sendPassword' => $journal_info['epassword'], // 期刊密码
+ 'from_name' => $journal_info['title']
];
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
- sendEmail($editor_info['email'],$journal_info['title'], $journal_info['title'], $tt1, $journal_info['email'], $journal_info['epassword']);
-
+ sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt1, $journal_info['email'], $journal_info['epassword']);
+
//发送消息给编辑
add_usermsg($journal_info['editor_id'], 'New transfer manuscript ', '/articleDetailEditor?id=' . $article_info['article_id']);
-
- return json(['code'=>0]);
+
+ return json(['code' => 0]);
}
-
+
/**
* @title 作者拒绝转投
* @description 作者拒绝转投
@@ -477,45 +488,47 @@ class Article extends Controller {
* @param name:transfer_id type:int require:1 desc:转投id
*
*/
- public function trans_manu_no(){
+ public function trans_manu_no()
+ {
$data = $this->request->post();
-
+
//跟新转投表状态
- $this->article_transfer_obj->where('transfer_id',$data['transfer_id'])->update(['state'=>1]);
-
+ $this->article_transfer_obj->where('transfer_id', $data['transfer_id'])->update(['state' => 1]);
+
//提醒编辑作者拒绝了转投,email
-
+
return jsonSuccess([]);
}
/**
* 修改文章详情(作者)
*/
- public function editArticle() {
+ public function editArticle()
+ {
//接受参数查询信息
$data = $this->request->post();
-
+
$username = $data['username'];
$user_res = $this->user_obj->where(['account' => $username])->find();
- $article_old_info = $this->article_obj->where('article_id',$data['articleId'])->find();
+ $article_old_info = $this->article_obj->where('article_id', $data['articleId'])->find();
Db::startTrans();
-
+
//更新文章信息
$inset_data['keywords'] = $data['keyWords'];
$inset_data['fund'] = $data['fund'];
$inset_data['abstrart'] = $data['abstrart'];
$inset_data['author_act'] = 1;
- $inset_data['state'] = $article_old_info['accept_sn']==''?0:1;
+ $inset_data['state'] = $article_old_info['accept_sn'] == '' ? 0 : 1;
$where['article_id'] = $data['articleId'];
$up_res = $this->article_obj->where($where)->update($inset_data);
$article_info = $this->article_obj->where($where)->find();
- $journal_info = $this->journal_obj->where("journal_id",$article_info["journal_id"])->find();
-
+ $journal_info = $this->journal_obj->where("journal_id", $article_info["journal_id"])->find();
+
//更新作者信息
$aids = [];
foreach ($data['authorList'] as $v) {
- if (isset($v['art_aut_id'])) {//改
+ if (isset($v['art_aut_id'])) { //改
$up['art_aut_id'] = $aids[] = $v['art_aut_id'];
$up['firstname'] = $v['firstname'];
$up['lastname'] = $v['lastname'];
@@ -525,10 +538,10 @@ class Article extends Controller {
$up['country'] = $v['country'];
$up['email'] = $v['email'];
$up['address'] = $v['address'];
- $up['is_super'] = $v['isSuper'] == 'true'?1:0;
- $up['is_report'] = $v['isReport'] == 'true'?1:0;
+ $up['is_super'] = $v['isSuper'] == 'true' ? 1 : 0;
+ $up['is_report'] = $v['isReport'] == 'true' ? 1 : 0;
$this->article_author_obj->update($up);
- } else {//增
+ } else { //增
if ($v['firstname'] == '') {
continue;
}
@@ -541,25 +554,25 @@ class Article extends Controller {
$ins['country'] = $v['country'];
$ins['email'] = $v['email'];
$ins['address'] = $v['address'];
- $ins['is_super'] = $v['isSuper'] == 'true'?1:0;
- $ins['is_report'] = $v['isReport'] == 'true'?1:0;
+ $ins['is_super'] = $v['isSuper'] == 'true' ? 1 : 0;
+ $ins['is_report'] = $v['isReport'] == 'true' ? 1 : 0;
$aids[] = $this->article_author_obj->insertGetId($ins);
}
}
//删
$this->article_author_obj->where('article_id', $data['articleId'])->where('art_aut_id', 'not in', $aids)->update(['state' => 1]);
-
+
//增加article_msg
$insmsg_data['article_id'] = $data['articleId'];
$insmsg_data['content'] = '';
$insmsg_data['state_from'] = $article_old_info['state'];
- $insmsg_data['state_to'] = $article_old_info['accept_sn']==''?0:1;
+ $insmsg_data['state_to'] = $article_old_info['accept_sn'] == '' ? 0 : 1;
$insmsg_data['ctime'] = time();
$msg_res = $this->article_msg_obj->insert($insmsg_data);
-
+
//发送邮件
- $journal_info = $this->journal_obj->where('journal_id',$article_old_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_old_info['journal_id'])->find();
+ $editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find();
$tt = 'Dear editor,
';
$tt .= 'The author changed the manuscript’s status, please check.
';
$tt .= 'TMR Publishing Group';
@@ -576,63 +589,64 @@ class Article extends Controller {
// ];
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
- 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']);
+
//记录历史file信息
$res1 = self::save_article_file($data['articleId'], $user_res['user_id'], $user_res['account'], $data['coverLetter'], 'coverLetter');
$res2 = true;
- if(isset($data['picturesAndTables'])){
- foreach ($data['picturesAndTables'] as $v){
- $res2=$res2?self::save_article_file($data['articleId'], $user_res['user_id'], $user_res['account'], $v, 'picturesAndTables'):false;
+ if (isset($data['picturesAndTables'])) {
+ foreach ($data['picturesAndTables'] as $v) {
+ $res2 = $res2 ? self::save_article_file($data['articleId'], $user_res['user_id'], $user_res['account'], $v, 'picturesAndTables') : false;
}
}
-// self::save_article_file($data['articleId'], $user_res['user_id'], $user_res['account'], $data['picturesAndTables'], 'picturesAndTables');
- $res3=self::save_article_file($data['articleId'], $user_res['user_id'], $user_res['account'], $data['manuscirpt'], 'manuscirpt');
- $res4=self::save_article_file($data['articleId'],$user_res['user_id'],$user_res['account'],$data['totalpage'],'totalpage');
+ // self::save_article_file($data['articleId'], $user_res['user_id'], $user_res['account'], $data['picturesAndTables'], 'picturesAndTables');
+ $res3 = self::save_article_file($data['articleId'], $user_res['user_id'], $user_res['account'], $data['manuscirpt'], 'manuscirpt');
+ $res4 = self::save_article_file($data['articleId'], $user_res['user_id'], $user_res['account'], $data['totalpage'], 'totalpage');
//增加用户操作log
$log_data['user_id'] = $article_info['user_id'];
$log_data['type'] = 1;
$log_data['content'] = $data['username'] . "(" . $user_res['realname'] . "),修改了一篇文章:" . $article_info['title'] . ",时间是:" . date('Y-m-d H:i:s', time());
$log_data['ctime'] = time();
- $log_res=$this->user_log_obj->insert($log_data);
+ $log_res = $this->user_log_obj->insert($log_data);
//增加usermsg
- $umsg_res=add_usermsg($journal_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();
return json(['code' => 0]);
- }else{
+ } else {
Db::rollback();
return json(['code' => 1]);
}
-
}
/**
* 获取全部作者反馈审稿人文件列表
*/
- public function getArticleResponseFiles(){
+ public function getArticleResponseFiles()
+ {
$data = $this->request->post();
$rule = new Validate([
- 'article_id'=>'require'
+ 'article_id' => 'require'
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $list = $this->article_response_to_reviewer_obj->where('article_id',$data['article_id'])->where('artr_state',0)->select();
+ $list = $this->article_response_to_reviewer_obj->where('article_id', $data['article_id'])->where('artr_state', 0)->select();
$re['files'] = $list;
return jsonSuccess($re);
}
-
- public function getAllCompany(){
+
+ public function getAllCompany()
+ {
$companys = $this->company_top_obj->select();
$re['companys'] = $companys;
return jsonSuccess($re);
}
-
+
/**
* @title 修回文章
* @description 修回文章
@@ -647,23 +661,24 @@ class Article extends Controller {
* @param name:responseFile type:string require:0 desc:作者反馈审稿人文件
*
*/
- public function RepairBack(){
+ public function RepairBack()
+ {
$data = $this->request->post();
-
+
$username = $data['username'];
$user_res = $this->user_obj->where(['account' => $username])->find();
- $article_old_info = $this->article_obj->where('article_id',$data['articleId'])->find();
-
+ $article_old_info = $this->article_obj->where('article_id', $data['articleId'])->find();
+
Db::startTrans();
-
+
$inset_data['author_act'] = 1;
$inset_data['state'] = 1;
$where['article_id'] = $data['articleId'];
$up_res = $this->article_obj->where($where)->update($inset_data);
$article_info = $this->article_obj->where($where)->find();
- $journal_info = $this->journal_obj->where("journal_id",$article_info["journal_id"])->find();
-
+ $journal_info = $this->journal_obj->where("journal_id", $article_info["journal_id"])->find();
+
//增加article_msg
$insmsg_data['article_id'] = $data['articleId'];
$insmsg_data['content'] = '';
@@ -671,9 +686,9 @@ class Article extends Controller {
$insmsg_data['state_to'] = 1;
$insmsg_data['ctime'] = time();
$msg_res = $this->article_msg_obj->insert($insmsg_data);
-
+
//发送邮件
- $editor_info = $this->user_obj->where('user_id',$journal_info['editor_id'])->find();
+ $editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find();
$tt = 'Dear editor,
';
$tt .= 'The author changed the manuscript’s status, please check.
';
$tt .= 'TMR Publishing Group';
@@ -689,40 +704,40 @@ class Article extends Controller {
// 'from_name'=>$journal_info['title']
// ];
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
-
-
+
+
$res2 = self::save_article_file($data['articleId'], $user_res['user_id'], $user_res['account'], $data['picturesAndTables'], 'picturesAndTables');
$res3 = self::save_article_file($data['articleId'], $user_res['user_id'], $user_res['account'], $data['manuscirpt'], 'manuscirpt');
-
+
//作者反馈审稿人信息文件
$res_response = true;
- if(isset($data['responseFile'])&&$data['responseFile']!=''){
+ if (isset($data['responseFile']) && $data['responseFile'] != '') {
$insert_response['article_id'] = $data['articleId'];
$insert_response['file_url'] = $data['responseFile'];
$insert_response['artr_ctime'] = time();
$res_response = $this->article_response_to_reviewer_obj->insert($insert_response);
}
-
-
+
+
//增加用户操作log
$log_data['user_id'] = $article_info['user_id'];
$log_data['type'] = 1;
$log_data['content'] = $data['username'] . "(" . $user_res['realname'] . "),修改了一篇文章:" . $article_info['title'] . ",时间是:" . date('Y-m-d H:i:s', time());
$log_data['ctime'] = time();
- $log_res=$this->user_log_obj->insert($log_data);
-
+ $log_res = $this->user_log_obj->insert($log_data);
+
//增加usermsg
- $umsg_res=add_usermsg($journal_info['editor_id'], 'The manuscript has new process: ' . $article_info['title'], '/articleDetailEditor?id=' . $article_info['article_id']);
-
- if($msg_res&&$res2&&$res3&&$log_res&&$umsg_res&&$res_response){
+ $umsg_res = add_usermsg($journal_info['editor_id'], 'The manuscript has new process: ' . $article_info['title'], '/articleDetailEditor?id=' . $article_info['article_id']);
+
+ if ($msg_res && $res2 && $res3 && $log_res && $umsg_res && $res_response) {
Db::commit();
return json(['code' => 0]);
- }else{
+ } else {
Db::rollback();
return jsonError("system error!");
}
}
-
+
/**
* @title 发送留言板消息
* @description 发送留言板消息
@@ -735,19 +750,20 @@ class Article extends Controller {
* @param name:ad_content type:String require:1 desc:内容
*
*/
- public function pushArticleDialog(){
+ public function pushArticleDialog()
+ {
$data = $this->request->post();
- $user_info = $this->user_obj->where('account',$data['username'])->find();
+ $user_info = $this->user_obj->where('account', $data['username'])->find();
$insert['article_id'] = $data['article_id'];
$insert['user_id'] = $user_info['user_id'];
$insert['ad_content'] = trim($data['ad_content']);
$insert['ad_ctime'] = time();
$this->article_dialog_obj->insert($insert);
//留言红点提示并邮件
- $this->messageTips($data['article_id'],$user_info['user_id']);
+ $this->messageTips($data['article_id'], $user_info['user_id']);
return jsonSuccess([]);
}
-
+
/**
* @title 获取留言板消息列表
* @description 获取留言板消息列表
@@ -761,19 +777,20 @@ class Article extends Controller {
* @dialogs ad_id:主键 article_id:文章id user_id:用户id username:用户名 ad_content:消息 ad_time:时间 ad_state:状态
*
*/
- public function getArticleDialogs(){
+ public function getArticleDialogs()
+ {
$data = $this->request->post();
$list = $this->article_dialog_obj
- ->field("t_article_dialog.*,t_user.account username")
- ->join("t_user","t_user.user_id = t_article_dialog.user_id","left")
- ->where("t_article_dialog.article_id",$data['article_id'])
- ->where('t_article_dialog.ad_state',0)
- ->select();
-
+ ->field("t_article_dialog.*,t_user.account username")
+ ->join("t_user", "t_user.user_id = t_article_dialog.user_id", "left")
+ ->where("t_article_dialog.article_id", $data['article_id'])
+ ->where('t_article_dialog.ad_state', 0)
+ ->select();
+
$re['dialogs'] = $list;
return jsonSuccess($re);
}
-
+
/**
* @title 添加修回页修回意见(编辑)
* @description 添加修回页修回意见(编辑)
@@ -785,7 +802,8 @@ class Article extends Controller {
* @param name:proposal_file type:String require:1 desc:文件地址
*
*/
- public function addArticleProposal(){
+ public function addArticleProposal()
+ {
$data = $this->request->post();
$insert['article_id'] = $data['article_id'];
$insert['proposal_file'] = trim($data['proposal_file']);
@@ -793,7 +811,7 @@ class Article extends Controller {
$this->article_proposal_obj->insert($insert);
return jsonSuccess([]);
}
-
+
/**
* @title 获取修回页修回意见列表
* @description 获取修回页修回意见列表
@@ -806,9 +824,10 @@ class Article extends Controller {
* @return proposals:意见列表@
* @proposals proposal_id:主键 proposal_file:文件地址 ap_ctime:添加时间
*/
- public function getArticleProposals(){
+ public function getArticleProposals()
+ {
$data = $this->request->post();
- $list = $this->article_proposal_obj->where('article_id',$data['article_id'])->where('ap_state',0)->select();
+ $list = $this->article_proposal_obj->where('article_id', $data['article_id'])->where('ap_state', 0)->select();
$re['proposals'] = $list;
return jsonSuccess($re);
}
@@ -816,22 +835,23 @@ class Article extends Controller {
/**
* 修改文章的作者(作者)
*/
- public function saveAuthor() {
+ public function saveAuthor()
+ {
$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();
//更新作者(增删改)
$aids = [];
foreach ($data['authorList'] as $v) {
- if (isset($v['art_aut_id'])) {//改
+ if (isset($v['art_aut_id'])) { //改
$up['art_aut_id'] = $aids[] = $v['art_aut_id'];
$up['author'] = $v['author'];
$up['company'] = $v['company'];
$up['email'] = $v['email'];
$up['address'] = $v['address'];
$up['is_super'] = $v['is_super'] == 'true' ? 1 : 0;
- $up['is_report'] = $v['is_report'] == 'true'?1:0;
+ $up['is_report'] = $v['is_report'] == 'true' ? 1 : 0;
$this->article_author_obj->update($up);
- } else {//增
+ } else { //增
if ($v['author'] == '') {
continue;
}
@@ -841,43 +861,43 @@ class Article extends Controller {
$ins['email'] = $v['email'];
$ins['address'] = $v['address'];
$ins['is_super'] = $v['is_super'] == 'true' ? 1 : 0;
- $ins['is_report'] = $v['is_report'] == 'true'?1:0;
+ $ins['is_report'] = $v['is_report'] == 'true' ? 1 : 0;
$aids[] = $this->article_author_obj->insertGetId($ins);
}
}
//删
$this->article_author_obj->where('article_id', $data['articleId'])->where('art_aut_id', 'not in', $aids)->update(['state' => 1]);
-
+
//更新文章操作状态
- $this->article_obj->where('article_id',$data['articleId'])->update(['author_act'=>1]);
-
+ $this->article_obj->where('article_id', $data['articleId'])->update(['author_act' => 1]);
+
//发送邮件通知编辑
- $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();
+ $journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find();
+ $editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find();
+ // $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
$tt = 'Dear editor,
';
$tt .= 'The author changed the manuscript’s information, please check.';
- $sendUser=[
- 'title'=> $journal_info['title'], // 邮件标题
- 'content'=>$tt,//邮件内容
- 'user_id'=>$editor_info['user_id'], //收件人ID
- 'email'=>$editor_info['email'],// 收件人邮箱
- 'journal_id'=>$journal_info['journal_id'], // 期刊ID
- 'sendEmail'=>$journal_info['email'], // 期刊邮箱
- 'sendPassword'=>$journal_info['epassword'], // 期刊密码
- 'from_name'=>$journal_info['title']
+ $sendUser = [
+ 'title' => $journal_info['title'], // 邮件标题
+ 'content' => $tt, //邮件内容
+ 'user_id' => $editor_info['user_id'], //收件人ID
+ 'email' => $editor_info['email'], // 收件人邮箱
+ 'journal_id' => $journal_info['journal_id'], // 期刊ID
+ 'sendEmail' => $journal_info['email'], // 期刊邮箱
+ 'sendPassword' => $journal_info['epassword'], // 期刊密码
+ 'from_name' => $journal_info['title']
];
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
- sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt,$journal_info['email'],$journal_info['epassword']);
-
+ sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
+
//添加usermsg
- add_usermsg($journal_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]);
}
-
+
/**
* @title 修改文章状态(编辑)
@@ -895,79 +915,160 @@ class Article extends Controller {
*
*
*/
- public function editArticleEditor() {
+ public function editArticleEditor()
+ {
//接受参数,查询信息
$data = $this->request->post();
$where_editor['account'] = $data['editname'];
$editor_info = $this->user_obj->where($where_editor)->find();
$where_article['article_id'] = $data['articleId'];
$article_info = $this->article_obj->where($where_article)->find();
- $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();
+ $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();
+ $user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id", $user_info['user_id'])->find();
- if($article_info['state']==5||$article_info['state']==3){
+ if ($article_info['state'] == 5 || $article_info['state'] == 3) {
return jsonError("Status cannot be changed");
}
//判断文章的h指数是否添加
- $authors = $this->article_author_obj->where('article_id',$data['articleId'])->where('is_report',1)->select();
+ $authors = $this->article_author_obj->where('article_id', $data['articleId'])->where('is_report', 1)->select();
$h_check = false;
- foreach($authors as $v){
- $cache_report = $this->user_obj->where('email',$v['email'])->find();
- if($article_info['state']!=0||$cache_report['google_time']!=0){
+ foreach ($authors as $v) {
+ $cache_report = $this->user_obj->where('email', $v['email'])->find();
+ if ($article_info['state'] != 0 || $cache_report['google_time'] != 0 || $data['state'] == 3) {
$h_check = true;
break;
}
}
- if($h_check==false){
+ if ($h_check == false) {
return jsonError('Please complete the H-index before proceeding');
}
+
+ //初审分数不够,自动拒稿
+ if ($article_info['state'] == 0 && $article_info['type'] != 'N' && $article_info['type'] != 'T') {
+ if (($journal_info['journal_id'] == 1 && $article_info['scoring'] < 4) || (($journal_info['journal_id'] == 10 || $journal_info['journal_id'] == 23) && $article_info['scoring'] < 3) || ($journal_info['journal_id'] == 16 && $article_info['scoring'] < 2) || ($journal_info['journal_id'] != 1 && $journal_info['journal_id'] != 10 && $journal_info['journal_id'] != 23 && $article_info['scoring'] < 1.5)) {
+ if (count($transfer_list) > 0) {
+ //查询转投期刊信息
+ $transfer_journal = $this->journal_obj->where('journal_id', $transfer_list[0]['journal_id'])->find();
+ //转投
+ $this->article_obj->where('article_id', $data['articleId'])->update(['state' => 0, 'journal_id' => $transfer_list[0]['journal_id'], 'author_act' => 1, 'editor_id' => $transfer_journal['editor_id']]);
+ //转投信息表信息状态改变
+ $this->article_transfer_obj->where('transfer_id', $transfer_list[0]['transfer_id'])->update(['state' => 1]);
+ //查找转投journal信息
+ $tran_journal = $this->journal_obj->where('journal_id', $transfer_list[0]['journal_id'])->find();
+ //转投后的作者信息
+ $trans_editor_info = $this->user_obj->where('user_id', $transfer_journal['editor_id'])->find();
+ //添加文章状态信息
+ $insert_data['article_id'] = $data['articleId'];
+ $insert_data['content'] = 'manuscript transfer to :' . $tran_journal['title'];
+ $insert_data['state_from'] = $article_info['state'];
+ $insert_data['state_to'] = 0;
+ $insert_data['ctime'] = time();
+ $this->article_msg_obj->insert($insert_data);
+ $user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id", $user_info['user_id'])->find();
+ //发送邮件提醒转投给作者
+ $tt = '"' . $article_info['title'] . '"
';
+ $tt .= $article_info['accept_sn'] . '
';
+ $tt .= 'journal:' . $journal_info['title'] . '
';
+ $tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
';
+ $tt .= 'Thank you for submitting your paper to ' . $journal_info['title'] . '. Your manuscript has undergone review.
';
+ $tt .= 'Unfortunately the editors feel that ' . $journal_info['title'] . ' is not the appropriate venue for your manuscript. You munuscript will transfer to journal - ' . $tran_journal['title'] . ' as you co-submitting chose order.If you have questions about the Co-submission process, please contact publisher@tmrjournals.com within 48 hours.
Yours sincerely,
';
+ $tt .= 'Editorial Office
';
+ $tt .= $journal_info['title'] . '
';
+ $tt .= 'Subscribe to this journal
';
+ $tt .= 'Email: ' . $journal_info['email'] . '
';
+ $tt .= 'Website: ' . $tran_journal['website'];
+
+ $sendUser['user_id'] = $user_info['user_id'];
+ $sendUser['email'] = $user_info['email'];
+ $sendUser['content'] = $tt;
+ // Queue::push('app\api\job\domail@fire',$sendUser,'domail');
+
+ sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
+
+ //发送邮件提醒编辑有新的转投稿件
+ $tt1 = 'Dear editor';
+ $tt1 .= 'Please check the new transfer manuscript in the submission system.';
+ sendEmail($trans_editor_info['email'], $journal_info['title'], $journal_info['title'], $tt1, $journal_info['email'], $journal_info['epassword']);
+
+ //增加usermsg
+ add_usermsg($tran_journal['editor_id'], 'New transfer manuscript ', '/articleDetailEditor?id=' . $article_info['article_id']);
+
+ return json(['code' => 0]);
+
+ } else {
+ $this->article_obj->where('article_id', $article_info['article_id'])->update(['state' => 3]);
+ $tt = '"' . $article_info['title'] . '"
';
+ $tt .= $article_info['accept_sn'] . '
';
+ $tt .= 'journal:' . $journal_info['title'] . '
';
+ $tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
';
+ $tt .= 'Thank you for submitting your paper to ' . $journal_info['title'] . '.
';
+ $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. '
+ . '
Yours sincerely,
';
+ $tt .= 'Sincerely,
Editorial Office
';
+ $tt .= $journal_info['title'] . '
';
+ $tt .= 'Subscribe to this journal
';
+ $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']);
+ //添加文章状态信息(如果状态未更新可做通话用,并结束操作)
+ $insert_dataj['article_id'] = $data['articleId'];
+ $insert_dataj['state_from'] = $article_info['state'];
+ $insert_dataj['state_to'] = 3;
+ $insert_dataj['ctime'] = time();
+ $this->article_msg_obj->insert($insert_dataj);
+ return jsonSuccess([]);
+ }
+ }
+ }
+
// 发送邮件内容
- $sendUser=[
- 'title'=> $journal_info['title'], // 邮件标题
- 'user_id'=>$user_info['user_id'],
- 'email'=>$user_info['email'],
- 'journal_id'=>$journal_info['journal_id'], // 期刊ID
- 'sendEmail'=>$journal_info['email'], // 期刊邮箱
- 'sendPassword'=>$journal_info['epassword'], // 期刊密码
- 'from_name'=>$journal_info['title']
+ $sendUser = [
+ 'title' => $journal_info['title'], // 邮件标题
+ 'user_id' => $user_info['user_id'],
+ 'email' => $user_info['email'],
+ 'journal_id' => $journal_info['journal_id'], // 期刊ID
+ 'sendEmail' => $journal_info['email'], // 期刊邮箱
+ 'sendPassword' => $journal_info['epassword'], // 期刊密码
+ 'from_name' => $journal_info['title']
];
- 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();
+ $transfer_journal = $this->journal_obj->where('journal_id', $transfer_list[0]['journal_id'])->find();
//转投
- $this->article_obj->where('article_id',$data['articleId'])->update(['state'=>1,'journal_id'=>$transfer_list[0]['journal_id'],'author_act'=>1,'editor_id'=>$transfer_journal['editor_id']]);
+ $this->article_obj->where('article_id', $data['articleId'])->update(['state' => 1, 'journal_id' => $transfer_list[0]['journal_id'], 'author_act' => 1, 'editor_id' => $transfer_journal['editor_id']]);
//转投信息表信息状态改变
- $this->article_transfer_obj->where('transfer_id',$transfer_list[0]['transfer_id'])->update(['state'=>1]);
+ $this->article_transfer_obj->where('transfer_id', $transfer_list[0]['transfer_id'])->update(['state' => 1]);
//查找转投journal信息
- $tran_journal = $this->journal_obj->where('journal_id',$transfer_list[0]['journal_id'])->find();
+ $tran_journal = $this->journal_obj->where('journal_id', $transfer_list[0]['journal_id'])->find();
//转投后的作者信息
- $trans_editor_info = $this->user_obj->where('user_id',$transfer_journal['editor_id'])->find();
-
+ $trans_editor_info = $this->user_obj->where('user_id', $transfer_journal['editor_id'])->find();
+
//添加文章状态信息
$insert_data['article_id'] = $data['articleId'];
- $insert_data['content'] = 'manuscript transfer to :'.$tran_journal['title'];
+ $insert_data['content'] = 'manuscript transfer to :' . $tran_journal['title'];
$insert_data['state_from'] = $article_info['state'];
$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();
+ $user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id", $user_info['user_id'])->find();
//发送邮件提醒转投给作者
- $tt = '"'.$article_info['title'].'"
';
- $tt .= $article_info['accept_sn'].'
';
- $tt .= 'journal:'.$journal_info['title'].'
';
-
- $tt .= 'Dear Dr. '.($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
';
- $tt .= 'Thank you for submitting your paper to '.$journal_info['title'].'. Your manuscript has undergone review.
';
- $tt .= 'Unfortunately the editors feel that '.$journal_info['title'].' is not the appropriate venue for your manuscript. You munuscript will transfer to journal - '.$tran_journal['title'].' as you co-submitting chose order.If you have questions about the Co-submission process, please contact publisher@tmrjournals.com within 48 hours.
Yours sincerely,
';
+ $tt = '"' . $article_info['title'] . '"
';
+ $tt .= $article_info['accept_sn'] . '
';
+ $tt .= 'journal:' . $journal_info['title'] . '
';
+
+ $tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
';
+ $tt .= 'Thank you for submitting your paper to ' . $journal_info['title'] . '. Your manuscript has undergone review.
';
+ $tt .= 'Unfortunately the editors feel that ' . $journal_info['title'] . ' is not the appropriate venue for your manuscript. You munuscript will transfer to journal - ' . $tran_journal['title'] . ' as you co-submitting chose order.If you have questions about the Co-submission process, please contact publisher@tmrjournals.com within 48 hours.
Yours sincerely,
';
$tt .= 'Editorial Office
';
- $tt .= $journal_info['title'].'
';
- $tt .= 'Subscribe to this journal
';
- $tt .= 'Email: '.$journal_info['email'].'
';
- $tt .= 'Website: '.$tran_journal['website'];
+ $tt .= $journal_info['title'] . '
';
+ $tt .= 'Subscribe to this journal
';
+ $tt .= 'Email: ' . $journal_info['email'] . '
';
+ $tt .= 'Website: ' . $tran_journal['website'];
$sendUser['user_id'] = $user_info['user_id'];
$sendUser['email'] = $user_info['email'];
@@ -975,45 +1076,51 @@ class Article extends Controller {
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
-
+
//发送邮件提醒编辑有新的转投稿件
$tt1 = 'Dear editor';
$tt1 .= 'Please check the new transfer manuscript in the submission system.';
- sendEmail($trans_editor_info['email'],$journal_info['title'], $journal_info['title'], $tt1, $journal_info['email'], $journal_info['epassword']);
+ sendEmail($trans_editor_info['email'], $journal_info['title'], $journal_info['title'], $tt1, $journal_info['email'], $journal_info['epassword']);
//增加usermsg
add_usermsg($tran_journal['editor_id'], 'New transfer manuscript ', '/articleDetailEditor?id=' . $article_info['article_id']);
-
- return json(['code'=>0]);
- }else{
+
+ return json(['code' => 0]);
+ } else {
//接收文章,必须有两个及以上的大于40个字的对作者的评论,除去news和comment类型的文章
- if($data['state']==5&&$article_info['type']!="N"&&$article_info['type']!="T"&&$article_info['type']!="LTE"&&$article_info['journal_id']!=21){
+ if ($data['state'] == 5 && $article_info['type'] != "N" && $article_info['type'] != "T" && $article_info['type'] != "LTE" && $article_info['journal_id'] != 21) {
//定义符合条件的数量
$rev_real_num = 0;
//获取通过的审稿意见数,必须大于两个
$rev_list = $this->article_reviewer_obj
- ->field('t_article_reviewer_question.*')
- ->join("t_article_reviewer_question",'t_article_reviewer_question.art_rev_id = t_article_reviewer.art_rev_id','left')
- ->where('t_article_reviewer.article_id',$article_info['article_id'])
- ->where('t_article_reviewer.state','in',[1,3])
- ->select();
- foreach ($rev_list as $v){
- $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){
+ ->field('t_article_reviewer_question.*')
+ ->join("t_article_reviewer_question", 't_article_reviewer_question.art_rev_id = t_article_reviewer.art_rev_id', 'left')
+ ->where('t_article_reviewer.article_id', $article_info['article_id'])
+ ->where('t_article_reviewer.state', 'in', [1, 3])
+ ->select();
+ foreach ($rev_list as $v) {
+ $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(" ", $content);
- if(count($carray)>=40){
+ } else { //不含中文
+ $carray = explode(" ", $content);
+ if (count($carray) >= 40) {
$rev_real_num++;
}
}
}
- if($rev_real_num<2){
- return json(['code'=>1,'msg'=>"More than two available reviewer-comments are necessary before going next step."]);
+ if ($rev_real_num < 2) {
+ return json(['code' => 1, 'msg' => "More than two available reviewer-comments are necessary before going next step."]);
}
}
+ //接收必须查重小于30%
+ if ($data['state'] == 5 && $article_info['repetition'] > 30) {
+ return jsonError("Submissions with a repetition rate greater than thirty percent will not be accepted");
+ }
+
+
//添加文章状态信息(如果状态未更新可做通话用,并结束操作)
$insert_data['article_id'] = $data['articleId'];
@@ -1023,128 +1130,126 @@ class Article extends Controller {
$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]);
+ $this->article_obj->where($where_article)->update(['editor_act' => 1]);
return json(['code' => 0]);
}
$update_data['state'] = $data['state'];
$update_data['editor_act'] = 1;
//更新文章状态
- if($data['state']==4){
+ if ($data['state'] == 4) {
$update_data['ttime'] = time();
//退休状态,添加退修时编辑的意见
- if(isset($data['proposal_content'])&&$data['proposal_content']!=''){//存在这个修回的文件
+ if (isset($data['proposal_content']) && $data['proposal_content'] != '') { //存在这个修回的文件
$insert_proposal['article_id'] = $data['articleId'];
$insert_proposal['proposal_content'] = trim($data['proposal_content']);
$insert_proposal['ap_ctime'] = time();
$this->article_proposal_obj->insert($insert_proposal);
}
}
- if($data['state']==3){
+ if ($data['state'] == 3) {
$update_data['rstime'] = time();
}
$this->article_obj->where($where_article)->update($update_data);
//拒稿或者录用 - 发送审稿意见
- if( $article_info['journal_id'] == 1 && ($data['state'] == 3 || $data['state'] == 5) ){
- $this->sendEmailToReviewer($data['articleId'],$data['state']);
+ if ($article_info['journal_id'] == 1 && ($data['state'] == 3 || $data['state'] == 5)) {
+ $this->sendEmailToReviewer($data['articleId'], $data['state']);
}
}
//发送文章状态更改邮件
- if($data['state']==3){//拒稿
- if($data['trsjournal']==0){
- $tt = '"'.$article_info['title'].'"
';
- $tt .= $article_info['accept_sn'].'
';
- $tt .= 'journal:'.$journal_info['title'].'
';
- $tt .= 'Dear Dr. '.($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
';
- $tt .= 'Thank you for submitting your paper to '.$journal_info['title'].'. Your manuscript has undergone review.
';
- $tt .= 'Unfortunately the editors feel that '.$journal_info['title'].' is not the appropriate venue for your manuscript,'
- . ' and we are returning your manuscript to you so that you can submit it to another journal without delay. '
- . '
Yours sincerely,
';
+ if ($data['state'] == 3) { //拒稿
+ if ($data['trsjournal'] == 0) {
+ $tt = '"' . $article_info['title'] . '"
';
+ $tt .= $article_info['accept_sn'] . '
';
+ $tt .= 'journal:' . $journal_info['title'] . '
';
+ $tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
';
+ $tt .= 'Thank you for submitting your paper to ' . $journal_info['title'] . '. Your manuscript has undergone review.
';
+ $tt .= 'Unfortunately the editors feel that ' . $journal_info['title'] . ' is not the appropriate venue for your manuscript,'
+ . ' and we are returning your manuscript to you so that you can submit it to another journal without delay. '
+ . '
Yours sincerely,
';
$tt .= 'Sincerely,
Editorial Office
';
- }else{//转投
+ } else { //转投
//查找转投journal信息
- $trans_journal = $this->journal_obj->where('journal_id',$data['trsjournal'])->find();
- $tt = 'Dear Dr. '.($user_info['realname']==""?$user_info['account']:$user_info['realname']).'
';
- $tt .= 'Thank you very much for submitting your manuscript "'.$article_info['title'].'" ('.$article_info['accept_sn'].'). We had read your paper discussed it with our editorial team. Unfortunately, our opinion is that the paper would not be a strong candidate for '.$journal_info['title'].'. When a paper is turned down on editorial grounds, we aim to return it to the authors as quickly as possible, avoiding a time-consuming peer-review process.
';
- $tt .= 'Nevertheless, thank you for giving us the opportunity to consider your work. I am sorry that we cannot be more positive on this occasion and hope you are soon able to find an alternative journal. Although we cannot offer to publish your paper in '.$journal_info['title'].', the work may be appropriate for another journal in the TMR Publishing Group.
';
- $tt .= 'I have asked the editor of '.$trans_journal['title'].' ('.$trans_journal['website'].'), and there is a good chance that your manuscript will be published there. If you wish to transfer your manuscript to a journal of your choice, please click on the agree button in the Submission System, you will not have to re-supply manuscript metadata and files.
';
+ $trans_journal = $this->journal_obj->where('journal_id', $data['trsjournal'])->find();
+ $tt = 'Dear Dr. ' . ($user_info['realname'] == "" ? $user_info['account'] : $user_info['realname']) . '
';
+ $tt .= 'Thank you very much for submitting your manuscript "' . $article_info['title'] . '" (' . $article_info['accept_sn'] . '). We had read your paper discussed it with our editorial team. Unfortunately, our opinion is that the paper would not be a strong candidate for ' . $journal_info['title'] . '. When a paper is turned down on editorial grounds, we aim to return it to the authors as quickly as possible, avoiding a time-consuming peer-review process.
';
+ $tt .= 'Nevertheless, thank you for giving us the opportunity to consider your work. I am sorry that we cannot be more positive on this occasion and hope you are soon able to find an alternative journal. Although we cannot offer to publish your paper in ' . $journal_info['title'] . ', the work may be appropriate for another journal in the TMR Publishing Group.
';
+ $tt .= 'I have asked the editor of ' . $trans_journal['title'] . ' (' . $trans_journal['website'] . '), and there is a good chance that your manuscript will be published there. If you wish to transfer your manuscript to a journal of your choice, please click on the agree button in the Submission System, you will not have to re-supply manuscript metadata and files.
';
$tt .= 'Yours Sincerely,
';
- $tt .= $journal_info['title'].' | Editorial Office
';
- $tt .= 'Email: '.$journal_info['email'].'
';
- $tt .= 'Website:'.$journal_info['website'].'';
+ $tt .= $journal_info['title'] . ' | Editorial Office
';
+ $tt .= 'Email: ' . $journal_info['email'] . '
';
+ $tt .= 'Website:' . $journal_info['website'] . '';
}
- }else if($data['state']==5){//录用
+ } else if ($data['state'] == 5) { //录用
//录用后更新录用时间
- $this->article_obj->where('article_id',$article_info['article_id'])->update(['rtime'=> time()]);
-
- $tt = 'Manuscript ID: '.$article_info['accept_sn'].'
';
- $tt .= 'Manuscript Title: '.$article_info['title'].'
';
- $tt .= 'Authors’ Name: '.self::getArticleAuthors($article_info['article_id']).'
';
- $tt .= 'Dear Dr. '.($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
It is a distinct pleasure to inform you that your manuscript has been accepted for publication in '.$journal_info['title'].' (ISSN '.$journal_info['issn'].').
The editor will contact you further by email soon.
';
+ $this->article_obj->where('article_id', $article_info['article_id'])->update(['rtime' => time()]);
+
+ $tt = 'Manuscript ID: ' . $article_info['accept_sn'] . '
';
+ $tt .= 'Manuscript Title: ' . $article_info['title'] . '
';
+ $tt .= 'Authors’ Name: ' . self::getArticleAuthors($article_info['article_id']) . '
';
+ $tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
It is a distinct pleasure to inform you that your manuscript has been accepted for publication in ' . $journal_info['title'] . ' (ISSN ' . $journal_info['issn'] . ').
The editor will contact you further by email soon.
';
$tt .= 'Sincerely,
Editorial Office
';
- }else if($data['state']==4){//退修
- $tt = $article_info['accept_sn'].'
';
- $tt .= 'Dear Dr. '.($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
';
- $tt .= 'Thank you for submitting the manuscript to '.$journal_info['title'].'.
';
- $tt .= 'Please find the new comments in the "Author Center", Please submit your revised manuscript within two weeks.
';
+ } else if ($data['state'] == 4) { //退修
+ $tt = $article_info['accept_sn'] . '
';
+ $tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
';
+ $tt .= 'Thank you for submitting the manuscript to ' . $journal_info['title'] . '.
';
+ $tt .= 'Please find the new comments in the "Author Center", Please submit your revised manuscript within two weeks.
';
$tt .= 'If you need more time to revise, you can send E-mial to tell us.
';
$tt .= "Please also find the Manuscript Check List attached. Check and complete each item one by one. If you could put the completed form on the revised manuscript's last page, it would speed up the processing process of the manuscript. Please note that this is voluntary.
";
$tt .= 'Sincerely,
Editorial Office
';
- }else if($data['state']==6){//终审
- $tt = 'Dear Dr. '.($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
';
- $tt .= 'Manuscript status: Your manuscript "'.$article_info['title'].'" is under reviewing by editorial member team of '.$journal_info['title'].'.';
- }else{
- $tt = '"'.$article_info['title'].'"
';
- $tt .= $article_info['accept_sn'].'
';
- $tt .= 'journal:'.$journal_info['title'].'
';
- $tt .= 'Dear Dr. '.($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
Please check the new status of your manuscript online.
';
+ } else if ($data['state'] == 6) { //终审
+ $tt = 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
';
+ $tt .= 'Manuscript status: Your manuscript "' . $article_info['title'] . '" is under reviewing by editorial member team of ' . $journal_info['title'] . '.';
+ } else {
+ $tt = '"' . $article_info['title'] . '"
';
+ $tt .= $article_info['accept_sn'] . '
';
+ $tt .= 'journal:' . $journal_info['title'] . '
';
+ $tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
Please check the new status of your manuscript online.
';
}
- $tt .= $journal_info['title'].'
';
- $tt .= 'Subscribe to this journal
';
- $tt .= 'Email: '.$journal_info['email'].'
';
- $tt .= 'Website: '.$journal_info['website'];
- if($data['state']!=5||$journal_info['journal_id']!=9){
+ $tt .= $journal_info['title'] . '
';
+ $tt .= 'Subscribe to this journal
';
+ $tt .= 'Email: ' . $journal_info['email'] . '
';
+ $tt .= 'Website: ' . $journal_info['website'];
+ if ($data['state'] != 5 || $journal_info['journal_id'] != 9) {
$sendUser['content'] = $tt;
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
- if($data['state']==4){
- sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword'],ROOT_PATH . 'public' . DS.'system'.DS.'Checklist.docx');
- }else{
+ if ($data['state'] == 4) {
+ sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword'], ROOT_PATH . 'public' . DS . 'system' . DS . 'Checklist.docx');
+ } else {
sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
}
-
}
- 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 = 'Dear Dr. '.($v['realname']==''?$v['account']:$v['realname']).',
';
- $tts .= 'The manuscript entitled “'.$article_info['title'].'” has been peer-reviewed, revised and about to be published in '.$journal_info['title'].'.
';
+ 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 = 'Dear Dr. ' . ($v['realname'] == '' ? $v['account'] : $v['realname']) . ',
';
+ $tts .= 'The manuscript entitled “' . $article_info['title'] . '” has been peer-reviewed, revised and about to be published in ' . $journal_info['title'] . '.
';
$tts .= 'If you want to review this article, you could use it Submission System (Plese click here).
';
- $tts .= 'Your username: '.$v['account'].'
';
+ $tts .= 'Your username: ' . $v['account'] . '
';
$tts .= 'Password: 123456qwe (Original password)
';
$tts .= 'If you are unable to review it now, you may provide your comments at a later time at your convenience. Then ,there is no need to reply to this email.
';
$tts .= 'Any comments you make will be valued by the editorial board. Please bring into our knowledge if there is any potential Conflict of Interest.
';
- $tts .= 'Sincerely,
Editorial Office
'.$journal_info['title'].'
';
- $tts .= 'Email: '.$journal_info['email'].'
';
- $tts .= 'Website:'.$journal_info['website'].'';
+ $tts .= 'Sincerely,
Editorial Office
' . $journal_info['title'] . '
';
+ $tts .= 'Email: ' . $journal_info['email'] . '
';
+ $tts .= 'Website:' . $journal_info['website'] . '';
$sendUser['user_id'] = $v['user_id'];
$sendUser['email'] = $v['email'];
$sendUser['content'] = $tts;
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
- 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']);
}
-
}
-
+
//转投操作
- if($data['trsjournal']!=0){
+ if ($data['trsjournal'] != 0) {
$tran_data['article_id'] = $data['articleId'];
$tran_data['journal_id'] = $data['trsjournal'];
$tran_data['ctime'] = time();
$tran_data['state'] = 2;
$this->article_transfer_obj->insert($tran_data);
}
-
+
//增加用户操作log
$log_data['user_id'] = $editor_info['user_id'];
$log_data['type'] = 1;
@@ -1153,79 +1258,84 @@ class Article extends Controller {
$this->user_log_obj->insert($log_data);
//增加usermsg
- add_usermsg($article_info['user_id'], 'Your manuscript has new process: ' . $article_info['title'] , '/articleDetail?id=' . $article_info['article_id']);
+ add_usermsg($article_info['user_id'], 'Your manuscript has new process: ' . $article_info['title'], '/articleDetail?id=' . $article_info['article_id']);
return json(['code' => 0]);
}
- public function authorClear(){
+ public function authorClear()
+ {
$author = "Ying Chen1 *,Shi-yi Tao2,Lu Zhou2,De-shuang Yang2,Chong-xiang Xue1 #,Li Huang3 #";
}
-
-
- public function emailtest(){
- $v = $this->user_obj->where('user_id',54)->find();
- $journal_info = $this->journal_obj->where('journal_id',1)->find();
- $trans_journal = $this->journal_obj->where('journal_id',5)->find();
- $article_info = $this->article_obj->where('article_id',1058)->find();
- $tts = 'Dear Dr. '.($v['realname']==''?$v['account']:$v['realname']).',
';
- $tts .= 'The manuscript entitled “'.$article_info['title'].'” has been peer-reviewed, revised and about to be published in '.$journal_info['title'].'.
';
- $tts .= 'If you want to review this article, you could use it Submission System (Plese click here).
';
- $tts .= 'Your username: '.$v['account'].'
';
- $tts .= 'Password: 123456qwe (Original password)
';
- $tts .= 'If you are unable to review it now, you may provide your comments at a later time at your convenience. Then ,there is no need to reply to this email.
';
- $tts .= 'Any comments you make will be valued by the editorial board. Please bring into our knowledge if there is any potential Conflict of Interest.
';
- $tts .= 'Sincerely,
Editorial Office
'.$journal_info['title'].'
';
- $tts .= 'Email: '.$journal_info['email'].'
';
- $tts .= 'Website:'.$journal_info['website'].'';
- $sendReviewer=[
- 'title'=>'Your contribution is greatly appreciated', // 邮件标题
- 'content'=>$tts,//邮件内容
- 'user_id'=>$v['user_id'], //收件人ID
- 'email'=>$v['email'],// 收件人邮箱
- 'journal_id'=>$journal_info['journal_id'], // 期刊ID
- 'sendEmail'=>$journal_info['email'], // 期刊邮箱
- 'sendPassword'=>$journal_info['epassword'], // 期刊密码
- 'from_name'=>$journal_info['title'],
- ];
- // Queue::push('app\api\job\domail@fire',$sendReviewer,'domail');
- $res = sendEmail($v['email'], $journal_info['title'], $journal_info['title'], $tts, $journal_info['email'], $journal_info['epassword']);
- dump($res);
- }
-
- private function creatLoginUrlForChief($user,$article_id){
- $code = md5(time().rand(1000,9999).'thinkphp');
+ // public function emailtest()
+ // {
+ // $v = $this->user_obj->where('user_id', 54)->find();
+ // $journal_info = $this->journal_obj->where('journal_id', 1)->find();
+ // $trans_journal = $this->journal_obj->where('journal_id', 5)->find();
+ // $article_info = $this->article_obj->where('article_id', 1058)->find();
+ // $tts = 'Dear Dr. ' . ($v['realname'] == '' ? $v['account'] : $v['realname']) . ',
';
+ // $tts .= 'The manuscript entitled “' . $article_info['title'] . '” has been peer-reviewed, revised and about to be published in ' . $journal_info['title'] . '.
';
+ // $tts .= 'If you want to review this article, you could use it Submission System (Plese click here).
';
+ // $tts .= 'Your username: ' . $v['account'] . '
';
+ // $tts .= 'Password: 123456qwe (Original password)
';
+ // $tts .= 'If you are unable to review it now, you may provide your comments at a later time at your convenience. Then ,there is no need to reply to this email.
';
+ // $tts .= 'Any comments you make will be valued by the editorial board. Please bring into our knowledge if there is any potential Conflict of Interest.
';
+ // $tts .= 'Sincerely,
Editorial Office
' . $journal_info['title'] . '
';
+ // $tts .= 'Email: ' . $journal_info['email'] . '
';
+ // $tts .= 'Website:' . $journal_info['website'] . '';
+
+ // $sendReviewer = [
+ // 'title' => 'Your contribution is greatly appreciated', // 邮件标题
+ // 'content' => $tts, //邮件内容
+ // 'user_id' => $v['user_id'], //收件人ID
+ // 'email' => $v['email'], // 收件人邮箱
+ // 'journal_id' => $journal_info['journal_id'], // 期刊ID
+ // 'sendEmail' => $journal_info['email'], // 期刊邮箱
+ // 'sendPassword' => $journal_info['epassword'], // 期刊密码
+ // 'from_name' => $journal_info['title'],
+ // ];
+ // // Queue::push('app\api\job\domail@fire',$sendReviewer,'domail');
+
+ // $res = sendEmail($v['email'], $journal_info['title'], $journal_info['title'], $tts, $journal_info['email'], $journal_info['epassword']);
+ // dump($res);
+ // }
+
+ private function creatLoginUrlForChief($user, $article_id)
+ {
+ $code = md5(time() . rand(1000, 9999) . 'thinkphp');
$insert['user_id'] = $user['user_id'];
$insert['code'] = $code;
$insert['ctime'] = time();
$this->login_auto_obj->insert($insert);
- $url = 'https://submission.tmrjournals.com/man_text?Art_id='.$article_id.'&act='.$code;
+ $url = 'https://submission.tmrjournals.com/man_text?Art_id=' . $article_id . '&act=' . $code;
return $url;
}
-
- public function creatLoginUrlForreviewer($user,$article_id){
- $code = md5(time().rand(1000,9999).'thinkphp');
+
+ public function creatLoginUrlForreviewer($user, $article_id)
+ {
+ $code = md5(time() . rand(1000, 9999) . 'thinkphp');
$insert['user_id'] = $user['user_id'];
$insert['code'] = $code;
$insert['ctime'] = time();
$this->login_auto_obj->insert($insert);
- $url = 'https://submission.tmrjournals.com/per_text?Art_id='.$article_id.'&act='.$code;
+ $url = 'https://submission.tmrjournals.com/per_text?Art_id=' . $article_id . '&act=' . $code;
return $url;
}
-
-
- public function creatRejectUrlForReviewer($user,$article_id){
- $code = md5(time().rand(1000,9999).'thinkphp');
+
+
+ public function creatRejectUrlForReviewer($user, $article_id)
+ {
+ $code = md5(time() . rand(1000, 9999) . 'thinkphp');
$insert['user_id'] = $user['user_id'];
$insert['code'] = $code;
$insert['ctime'] = time();
$this->login_auto_obj->insert($insert);
- $url = 'https://submission.tmrjournals.com/per_text_fail?Art_id='.$article_id.'&act='.$code;
+ $url = 'https://submission.tmrjournals.com/per_text_fail?Art_id=' . $article_id . '&act=' . $code;
return $url;
}
-
+
/**
* @title 获取期刊by领域
* @description 获取期刊by领域
@@ -1237,16 +1347,17 @@ class Article extends Controller {
*
* @return journals:期刊列表#
*/
- public function getJournalsByMajor(){
+ public function getJournalsByMajor()
+ {
$data = $this->request->post();
-// $data['major_id'] = 60;
+ // $data['major_id'] = 60;
$list = $this->major_to_journal_obj
- ->field("t_journal.*")
- ->join("t_journal","t_journal.issn = t_major_to_journal.journal_issn","left")
- ->where("t_major_to_journal.major_id",$data['major_id'])
- ->where('t_major_to_journal.mtj_state',0)
- ->select();
-
+ ->field("t_journal.*")
+ ->join("t_journal", "t_journal.issn = t_major_to_journal.journal_issn", "left")
+ ->where("t_major_to_journal.major_id", $data['major_id'])
+ ->where('t_major_to_journal.mtj_state', 0)
+ ->select();
+
$re['journals'] = $list;
return jsonSuccess($re);
}
@@ -1255,13 +1366,14 @@ class Article extends Controller {
/**
* 编辑文章备注
*/
- public function editArticleRemark(){
+ public function editArticleRemark()
+ {
//接受参数
$data = $this->request->post();
- $this->article_obj->where('article_id',$data['articleId'])->update(['remarks'=>$data['content']]);
- return json(['code'=>0]);
+ $this->article_obj->where('article_id', $data['articleId'])->update(['remarks' => $data['content']]);
+ return json(['code' => 0]);
}
-
+
/**
* @title 更改重复率(编辑)
* @description 更改重复率(编辑)
@@ -1274,52 +1386,54 @@ class Article extends Controller {
* @param name:zipurl type:string require:1 desc:查重文件地址
*
*/
- public function changeRepetition(){
+ public function changeRepetition()
+ {
//接受参数
$data = $this->request->post();
- $this->article_obj->where('article_id',$data['articleId'])->update(['repetition'=>$data['repefen'],'repeurl'=>$data['zipurl']]);
- return json(['code'=>0]);
+ $this->article_obj->where('article_id', $data['articleId'])->update(['repetition' => $data['repefen'], 'repeurl' => $data['zipurl']]);
+ return json(['code' => 0]);
}
/**
* 更改文章详情(编辑)
*/
- public function changeArticleFileEditor() {
+ public function changeArticleFileEditor()
+ {
//接受参数查询信息
$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();
- $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
+ // $author_info = $this->user_obj->where('user_id',$article_info['user_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();
+ // $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
//存储文件入文件表
-// self::save_article_file($data['articleId'], $editor_info['user_id'], $editor_info['account'], $data['coverLetter'], 'coverLetter');
-// self::save_article_file($data['articleId'], $editor_info['user_id'], $editor_info['account'], $data['picturesAndTables'], 'picturesAndTables');
+ // self::save_article_file($data['articleId'], $editor_info['user_id'], $editor_info['account'], $data['coverLetter'], 'coverLetter');
+ // self::save_article_file($data['articleId'], $editor_info['user_id'], $editor_info['account'], $data['picturesAndTables'], 'picturesAndTables');
self::save_article_file($data['articleId'], $editor_info['user_id'], $editor_info['account'], $data['manuscirpt'], 'manuscirpt');
//更新文章状态(提醒用户)
$this->article_obj->where('article_id', $data['articleId'])->update(['editor_act' => 1]);
-
+
//添加article_msg信息
-// $insmsg_data['article_id'] = $data['articleId'];
-// $insmsg_data['content'] = '';
-// $insmsg_data['state_from'] = $article_info['state'];
-// $insmsg_data['state_to'] = 4;
-// $insmsg_data['ctime'] = time();
-// $this->article_msg_obj->insert($insmsg_data);
+ // $insmsg_data['article_id'] = $data['articleId'];
+ // $insmsg_data['content'] = '';
+ // $insmsg_data['state_from'] = $article_info['state'];
+ // $insmsg_data['state_to'] = 4;
+ // $insmsg_data['ctime'] = time();
+ // $this->article_msg_obj->insert($insmsg_data);
//发送email提醒用户
-// $tt = $article_info['accept_sn'].'
';
-// $tt .= 'Dear author,
';
-// $tt .= 'Thanks for submitting the manuscript to '.$journal_info['title'].'.
';
-// $tt .= 'Here are the comments in the "Author Center", Please submit your revised manuscript within two weeks.
';
-// $tt .= 'Sincerely,
Editorial Office
';
-// $tt .= $journal_info['title'].'
';
-// $tt .= 'Email:'.$journal_info['email'].'
';
-// $tt .= 'Website: '.$journal_info['website'];
-// sendEmail($author_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
-
+ // $tt = $article_info['accept_sn'].'
';
+ // $tt .= 'Dear author,
';
+ // $tt .= 'Thanks for submitting the manuscript to '.$journal_info['title'].'.
';
+ // $tt .= 'Here are the comments in the "Author Center", Please submit your revised manuscript within two weeks.
';
+ // $tt .= 'Sincerely,
Editorial Office
';
+ // $tt .= $journal_info['title'].'
';
+ // $tt .= 'Email:'.$journal_info['email'].'
';
+ // $tt .= 'Website: '.$journal_info['website'];
+ // sendEmail($author_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
+
//增加用户操作log
$log_data['user_id'] = $editor_info['user_id'];
$log_data['type'] = 1;
@@ -1337,17 +1451,18 @@ class Article extends Controller {
/**
* 获取文章文件
*/
- public function getFilesForArticle(){
+ public function getFilesForArticle()
+ {
$data = $this->request->post();
$rule = new Validate([
- 'article_id'=>'require',
- 'type'=>'require'
+ 'article_id' => 'require',
+ 'type' => 'require'
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$type = '';
- switch($data['type']){
+ switch ($data['type']) {
case "m":
$type = 'manuscirpt';
break;
@@ -1361,26 +1476,27 @@ class Article extends Controller {
$type = 'manuscirpt';
break;
}
- $files = $this->article_file_obj->where('article_id',$data['article_id'])->where('state',0)->where('type_name',$type)->order('ctime')->select();
+ $files = $this->article_file_obj->where('article_id', $data['article_id'])->where('state', 0)->where('type_name', $type)->order('ctime')->select();
$re['files'] = $files;
return jsonSuccess($re);
}
-
-
+
+
/**
* 添加文章审稿实例(编辑)
*/
- public function addArticleReviewer() {
+ public function addArticleReviewer()
+ {
//接收参数,查询数据
$data = $this->request->post();
-
+
$article_info = $this->article_obj->where('article_id', $data['articleId'])->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();
$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();
+ $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'];
@@ -1389,12 +1505,12 @@ class Article extends Controller {
$insert_data['ctime'] = time();
$insert_data['state'] = 5;
$res = $this->article_reviewer_obj->insertGetId($insert_data);
-
+
//修改文章状态->审稿中
- $this->article_obj->where('article_id',$data['articleId'])->update(['state'=>2]);
-
+ $this->article_obj->where('article_id', $data['articleId'])->update(['state' => 2]);
+
//添加article_msg信息
- if($article_info['state']!=2){
+ if ($article_info['state'] != 2) {
$insmsg_data['article_id'] = $data['articleId'];
$insmsg_data['content'] = '';
$insmsg_data['state_from'] = $article_info['state'];
@@ -1405,26 +1521,26 @@ class Article extends Controller {
//发送email提醒审稿员
$tt = $article_info['accept_sn'] . '
';
- $tt .= 'Dear Dr. '.($reviewer_info['realname']==""?$reviewer_info['account']:$reviewer_info['realname']).'
';
- $tt .= 'The manuscript entitled “'.$article_info['title'].'” has'
- . ' been submitted to the journal '.$journal_info['title'].'. The Editor-in-Chief would'
- . ' be most grateful if you could offer an opinion regarding its suitability for publication'
- . ' in the journal '.$journal_info['title'].'.
';
+ $tt .= 'Dear Dr. ' . ($reviewer_info['realname'] == "" ? $reviewer_info['account'] : $reviewer_info['realname']) . '
';
+ $tt .= 'The manuscript entitled “' . $article_info['title'] . '” has'
+ . ' been submitted to the journal ' . $journal_info['title'] . '. The Editor-in-Chief would'
+ . ' be most grateful if you could offer an opinion regarding its suitability for publication'
+ . ' in the journal ' . $journal_info['title'] . '.
';
$tt .= 'Please bring into our knowledge if there is any potential Conflict of Interest. If you agree to review this manuscript, we ask you to complete your review and submit it by submission system within 14 days of receipt of the manuscript.
';
$tt .= 'Thank you for your consideration.
Look forward for your reply.
';
- $tt .= 'Click here to accept the invitation to review
';
-// $tt .= 'Click here to review the article
';
- $tt .= 'Click here to decline the invitation to review
';
- $tt .= 'Your username:'.$reviewer_info['account'].'
';
+ $tt .= 'Click here to accept the invitation to review
';
+ // $tt .= 'Click here to review the article
';
+ $tt .= 'Click here to decline the invitation to review
';
+ $tt .= 'Your username:' . $reviewer_info['account'] . '
';
$tt .= 'Your original password:123456qwe, if you have reset the password, please login with the new one or click the "forgot password".
';
$tt .= 'Sincerely,
Editorial Office
';
- $tt .= 'Subscribe to this journal
';
- $tt .= $journal_info['title'].'
';
- $tt .= 'Email:'.$journal_info['email'].'
';
- $tt .= 'Website:'.$journal_info['website'];
+ $tt .= 'Subscribe to this journal
';
+ $tt .= $journal_info['title'] . '
';
+ $tt .= 'Email:' . $journal_info['email'] . '
';
+ $tt .= 'Website:' . $journal_info['website'];
sendEmail($reviewer_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
-
+
//记录userlog
$log_data['user_id'] = $article_info['editor_id'];
$log_data['type'] = 2;
@@ -1436,20 +1552,21 @@ class Article extends Controller {
add_usermsg($data['uid'], 'You have new manuscript to be approved', '/reviewerArticleDetail?id=' . $res);
return json(['code' => 0]);
}
-
+
/**
* 编辑添加审稿实例(临时开启,为了补充审稿实例不够)
*/
- public function addArtRev(){
+ public function addArtRev()
+ {
$data = $this->request->post();
-
+
//增加信息到文章审稿表
$insert['reviewer_id'] = $data['uid'];
$insert['article_id'] = $data['articleId'];
$insert['ctime'] = time();
$insert['state'] = 3;
$art_rev_id = $this->article_reviewer_obj->insertGetId($insert);
-
+
//添加问卷信息
$insert_data['art_rev_id'] = $art_rev_id;
$insert_data['qu1'] = $data['qu1'];
@@ -1460,19 +1577,19 @@ class Article extends Controller {
$insert_data['qu6'] = $data['qu6'];
$insert_data['qu7'] = $data['qu7'];
$insert_data['qu8'] = $data['qu8'];
- $insert_data['qu9'] = $data['qu9']?1:0;
+ $insert_data['qu9'] = $data['qu9'] ? 1 : 0;
$insert_data['qu9_contents'] = $data['qu9contents'];
- $insert_data['qu10'] = $data['qu10']?1:0;
+ $insert_data['qu10'] = $data['qu10'] ? 1 : 0;
$insert_data['qu10_contents'] = $data['qu10contents'];
- $insert_data['qu11'] = $data['qu11']?1:0;
+ $insert_data['qu11'] = $data['qu11'] ? 1 : 0;
$insert_data['qu11_contents'] = $data['qu11contents'];
- $insert_data['qu12'] = $data['qu12']?1:0;
+ $insert_data['qu12'] = $data['qu12'] ? 1 : 0;
$insert_data['qu12_contents'] = $data['qu12contents'];
- $insert_data['qu13'] = $data['qu13']?1:0;
+ $insert_data['qu13'] = $data['qu13'] ? 1 : 0;
$insert_data['qu13_contents'] = $data['qu13contents'];
- $insert_data['qu14'] = $data['qu14']?1:0;
+ $insert_data['qu14'] = $data['qu14'] ? 1 : 0;
$insert_data['qu14_contents'] = $data['qu14contents'];
- $insert_data['qu15'] = $data['qu15']?1:0;
+ $insert_data['qu15'] = $data['qu15'] ? 1 : 0;
$insert_data['qu15_contents'] = $data['qu15contents'];
$insert_data['rated'] = $data['rated'];
$insert_data['recommend'] = $data['recommend'];
@@ -1506,56 +1623,32 @@ class Article extends Controller {
* @return articles:文章列表#
* @return count:总数#
*/
- public function addArticle() {
+ public function addArticle()
+ {
+
+ die("Please update your browser cache and resubmit your submission (shortcut key: Ctrl+F5)");
//接受参数,查询信息
$data = $this->request->post();
- // $data['journal'] = 1;
- // $data['username'] = 'wangjinlei';
- // $data['title'] = 'test';
- // $data['major'] = 52;
- // $data['authorList'][0] = [
- // 'firstname'=>'name1',
- // 'lastname'=>'name22',
- // 'orcid'=>'fawradfsadf',
- // 'company'=>'dsadsa',
- // 'department'=>'name1',
- // 'title'=>'Assistant Prof.',
- // 'country'=>'Angola',
- // 'email'=>'sadf@65.com',
- // 'address'=>'address',
- // 'isSuper'=>'true',
- // 'isReport'=>'true'
- // ];
- // $data['abstrart']='dadsasd';
- // $data['type']='A';
- // $data['approval']='false';
- // $data['istransfer']='false';
- // $data['becomeRev']='false';
- // $data['keyWords']='sdfsfdf';
- // $data['fund']='adsada';
- // $data['coverLetter']='';
- // $data['totalpage']='';
- // $data['manuscirpt']='manuscirpt/20220424/0bfc8f5675911c2389dcd22b65c7e20c.docx';
$user_res = $this->user_obj->where('account', $data['username'])->find();
-
+
//确定用户是否属于黑名单
$black_check = $this->user_black_obj->where('user_id', $user_res['user_id'])->where('black_state', 0)->find();
if ($black_check) {
return jsonError("Your account has been blocked. Please contact the publisher for details: publisher@tmrjournals.com.");
}
-
+
// if($user_res['account']=='fariba'||$user_res['account']=='zc'||$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();
//首先查重是否重复投稿
- $checkArticle = $this->article_obj->where("title",trim($data['title']))->select();
- foreach ($checkArticle as $v){
- if($v['state']!=3){
- return json(['code'=>1,'msg'=>'Warning: you are re-submitting the article!']);
+ $checkArticle = $this->article_obj->where("title", trim($data['title']))->select();
+ foreach ($checkArticle as $v) {
+ if ($v['state'] != 3) {
+ return json(['code' => 1, 'msg' => 'Warning: you are re-submitting the article!']);
}
}
Db::startTrans();
@@ -1567,11 +1660,11 @@ class Article extends Controller {
$inset_data['title'] = trim($data['title']);
$inset_data['keywords'] = $data['keyWords'];
$inset_data['fund'] = trim($data['fund']);
- $inset_data['accept_sn'] = getArticleSN($journal_info['abbr'],$data['type']);
+ $inset_data['accept_sn'] = getArticleSN($journal_info['abbr'], $data['type']);
$inset_data['type'] = $data['type'];
$inset_data['major_id'] = $data['major'];
-// $inset_data['cmajor_id'] = $data['cmajor'];
- $inset_data['approval'] = $data['approval']=='true'?1:0;
+ // $inset_data['cmajor_id'] = $data['cmajor'];
+ $inset_data['approval'] = $data['approval'] == 'true' ? 1 : 0;
$inset_data['abstrart'] = $data['abstrart'];
$inset_data['author_act'] = 1;
$inset_data['ctime'] = time();
@@ -1596,35 +1689,35 @@ class Article extends Controller {
$i['email'] = trim($v['email']);
$i['address'] = trim($v['address']);
$i['is_super'] = $v['isSuper'] == 'true' ? 1 : 0;
- $i['is_report'] = $v['isReport'] == 'true'?1:0;
+ $i['is_report'] = $v['isReport'] == 'true' ? 1 : 0;
$authors[] = $i;
$cache['email'] = trim($v['email']);
- $cache['name'] = trim($v['firstname']).' '.trim($v['lastname']);
+ $cache['name'] = trim($v['firstname']) . ' ' . trim($v['lastname']);
$author_email[] = $cache;
//通讯作者用户添加
- if($v['isReport']=="true"){
- $re_user_check = $this->user_obj->where('account|email',trim($v['email']))->find();
- if(!$re_user_check){
+ if ($v['isReport'] == "true") {
+ $re_user_check = $this->user_obj->where('account|email', trim($v['email']))->find();
+ if (!$re_user_check) {
$password = getRandPassword();
$inser_data['account'] = trim($v['email']);
$inser_data['password'] = md5($password);
$inser_data['email'] = trim($v['email']);
- $inser_data['realname'] = trim($v['firstname']).' '.trim($v['lastname']);
+ $inser_data['realname'] = trim($v['firstname']) . ' ' . trim($v['lastname']);
$inser_data['ctime'] = time();
- $c_res_add_user=$this->user_obj->insertGetId($inser_data);
- if($res_add_user){
+ $c_res_add_user = $this->user_obj->insertGetId($inser_data);
+ if ($res_add_user) {
$res_add_user = $c_res_add_user;
}
//发送提示邮件给通讯作者
- $report_tt = "Dear ".$inser_data['realname'].',
';
- $report_tt .= "We are delighted to welcome you as a new author for our journal, ".$journal_info['title'].". We have received your submission and are excited to review it for potential publication.
";
- $report_tt .= "As a next step, we have created an account for you on our journal's website. Your account is [Username: ".trim($v['email'])." password:$password]";
- $report_tt .= "and you can access your account by visiting ".$journal_info['website']." and logging in.
";
+ $report_tt = "Dear " . $inser_data['realname'] . ',
';
+ $report_tt .= "We are delighted to welcome you as a new author for our journal, " . $journal_info['title'] . ". We have received your submission and are excited to review it for potential publication.
";
+ $report_tt .= "As a next step, we have created an account for you on our journal's website. Your account is [Username: " . trim($v['email']) . " password:$password]";
+ $report_tt .= "and you can access your account by visiting " . $journal_info['website'] . " and logging in.
";
$report_tt .= "If you have any questions or need assistance with accessing your account, please don't hesitate to contact us. We are here to support you throughout the submission and review process.
";
$report_tt .= "Thank you for choosing to submit your work to our journal. We look forward to working with you.
";
- $report_tt .= "Best regards,
".$inser_data['realname'].'
'.$journal_info['title'];
+ $report_tt .= "Best regards,
" . $inser_data['realname'] . '
' . $journal_info['title'];
$maidata['email'] = trim($v['email']);
$maidata['title'] = $journal_info['title'];
$maidata['content'] = $report_tt;
@@ -1635,64 +1728,64 @@ class Article extends Controller {
}
}
$res_author = $this->article_author_obj->insertAll($authors);
-
+
//增加转投信息
$transr = true;
- if($data['istransfer']=='true'){
- foreach ($data['checkedjours'] as $val){
+ if ($data['istransfer'] == 'true') {
+ foreach ($data['checkedjours'] as $val) {
$trans_insert['article_id'] = $res;
$trans_insert['journal_id'] = $val;
$trans_insert['ctime'] = time();
- $transr = $transr?$this->article_transfer_obj->insert($trans_insert):false;
+ $transr = $transr ? $this->article_transfer_obj->insert($trans_insert) : false;
}
}
-
-
+
+
//增加articlefile表的信息
$res_file1 = self::save_article_file($res, $user_res['user_id'], $user_res['account'], $data['coverLetter'], 'coverLetter');
$res_file2 = true;
- if(isset($data['picturesAndTables'])){
- foreach ($data['picturesAndTables'] as $v){
- $res_file2 = $res_file2?self::save_article_file($res, $user_res['user_id'], $user_res['account'], $v, 'picturesAndTables'):false;
+ if (isset($data['picturesAndTables'])) {
+ foreach ($data['picturesAndTables'] as $v) {
+ $res_file2 = $res_file2 ? self::save_article_file($res, $user_res['user_id'], $user_res['account'], $v, 'picturesAndTables') : false;
}
}
$res_file4 = self::save_article_file($res, $user_res['user_id'], $user_res['account'], $data['totalpage'], 'totalpage');
$res_file3 = self::save_article_file($res, $user_res['user_id'], $user_res['account'], $data['manuscirpt'], 'manuscirpt');
-
+
//发送邮件到编辑,提醒有待审文章
- $editor_info = $this->user_obj->where('user_id',$journal_info['editor_id'])->find();
+ $editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find();
$tt = 'Dear editor,
';
$tt .= 'Please check the new manuscript in the submission system.';
- sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt,$journal_info['email'],$journal_info['epassword']);
- $user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id",$user_res['user_id'])->find();
+ 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();
//发送邮件给作者,表示感谢
- $tt_t = 'Dear Dr. '.($user_res['realname']==''?$user_res['account']:$user_res['realname']).',
';
- $tt1 = 'Thank you for submitting your manuscript entitled "'.$data['title'].'". Your submission has been assigned the following tracking number:'.$inset_data['accept_sn'].'. We will be in touch again as soon as we have reached a decision. Please quote the tracking number in any communication. This e-mail simply acknowledges receipt of your submission. If the editors decide for editorial reasons that the paper is unsuitable for publication in '.$journal_info['title'].', you will be informed as soon as possible.
';
- if($journal_info['journal_id']==9){//life research 期刊发送收到文章邮件
+ $tt_t = 'Dear Dr. ' . ($user_res['realname'] == '' ? $user_res['account'] : $user_res['realname']) . ',
';
+ $tt1 = 'Thank you for submitting your manuscript entitled "' . $data['title'] . '". Your submission has been assigned the following tracking number:' . $inset_data['accept_sn'] . '. We will be in touch again as soon as we have reached a decision. Please quote the tracking number in any communication. This e-mail simply acknowledges receipt of your submission. If the editors decide for editorial reasons that the paper is unsuitable for publication in ' . $journal_info['title'] . ', you will be informed as soon as possible.
';
+ if ($journal_info['journal_id'] == 9) { //life research 期刊发送收到文章邮件
$tt1 .= 'Life Research applies the CC BY-NC 4.0 license. Full details of the policy can be found at https://www.tmrjournals.com/notice.html?J_num=14&footer_id=123. Authors should read Guide to Authors carefully before submitting.
';
$tt1 .= 'You may check on the status of this manuscript in the Submission System. If you encounter any problems, please contact liferes@tmrjournals.com.
';
$tt1 .= 'Thank you for choosing to submit your manuscript to Life Research.
';
$tt1 .= 'Yours sincerely,
Haoran Zhang
';
$tt1 .= 'Manuscript Administration, Life Research
https://www.tmrjournals.com/lr/';
- }else{//其他期刊发送邮件
- $tt1 .= 'You may check on the status of this manuscript in the Submission System. If you encounter any problems, please contact '.$journal_info['email'].'.
';
- $tt1 .= 'Thank you for choosing to submit your manuscript to '.$journal_info['title'].'.
';
+ } else { //其他期刊发送邮件
+ $tt1 .= 'You may check on the status of this manuscript in the Submission System. If you encounter any problems, please contact ' . $journal_info['email'] . '.
';
+ $tt1 .= 'Thank you for choosing to submit your manuscript to ' . $journal_info['title'] . '.
';
$tt1 .= 'Sincerely,
Editorial Office
';
- $tt1 .= 'Subscribe to this journal
';
- $tt1 .= $journal_info['title'].'
';
- $tt1 .= 'Email: '.$journal_info['email'].'
';
- $tt1 .= 'Website: '.$journal_info['website'].'
';
+ $tt1 .= 'Subscribe to this journal
';
+ $tt1 .= $journal_info['title'] . '
';
+ $tt1 .= 'Email: ' . $journal_info['email'] . '
';
+ $tt1 .= 'Website: ' . $journal_info['website'] . '
';
$tt1 .= '