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 .= '
If you have any questions, please contact us:
'; $tt1 .= 'Head of publication ethics
Dr. Dan Chen
TMR Publishing Group Limited Company, Auckland, New Zealand
Email: publication.ethics@tmrjournals.com'; } - sendEmail($user_res['email'],$journal_info['title'], $journal_info['title'], $tt_t.$tt1,$journal_info['email'],$journal_info['epassword']); + sendEmail($user_res['email'], $journal_info['title'], $journal_info['title'], $tt_t . $tt1, $journal_info['email'], $journal_info['epassword']); - foreach($author_email as $v){ - $cache_str = 'Dear Dr. '.$v['name'].',

'; + foreach ($author_email as $v) { + $cache_str = 'Dear Dr. ' . $v['name'] . ',

'; $maidata['email'] = $v['email']; $maidata['title'] = $journal_info['title']; - $maidata['content'] = $cache_str.$tt1; + $maidata['content'] = $cache_str . $tt1; $maidata['tmail'] = $journal_info['email']; $maidata['tpassword'] = $journal_info['epassword']; Queue::push('app\api\job\mail@fire', $maidata, "tmail"); @@ -1707,18 +1800,18 @@ class Article extends Controller { //增加usermsg $res_msg = add_usermsg($journal_info['editor_id'], 'New manuscript', '/articleDetailEditor?id=' . $res); - + //通讯作者转为审稿人 $this->addReviewerFromArticle($res, $journal_info['journal_id']); //推荐审稿人 $recommend_res = true; - $reviewers = isset($data['reviewers'])?$data['reviewers']:[]; - foreach($reviewers as $v){ - $recommend_res = $this->addRecommentReviewer($v,$journal_info['journal_id'],$user_res['user_id'],$res); + $reviewers = isset($data['reviewers']) ? $data['reviewers'] : []; + foreach ($reviewers as $v) { + $recommend_res = $this->addRecommentReviewer($v, $journal_info['journal_id'], $user_res['user_id'], $res); } - if ($res && $res_author && $transr && $res_add_user&&$res_file1 && $res_file2 && $res_file3 && $res_file4 && $res_log && $res_msg && $recommend_res) { + if ($res && $res_author && $transr && $res_add_user && $res_file1 && $res_file2 && $res_file3 && $res_file4 && $res_log && $res_msg && $recommend_res) { Db::commit(); $this->ai_scor($res); return json(['code' => 0]); @@ -1728,6 +1821,373 @@ class Article extends Controller { } } + /** + * 获取已暂存的文章列表 + */ + public function getSaveArticles() + { + $data = $this->request->post(); + $rule = new Validate([ + 'user_id' => 'require' + ]); + if (!$rule->check($data)) { + return jsonError($rule->getError()); + } + $list = $this->article_obj + ->field('t_article.*,t_journal.title journal_title') + ->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'left') + ->where('t_article.user_id', $data['user_id']) + ->where('t_article.state', -1) + ->select(); + $re['articles'] = $list; + return jsonSuccess($re); + } + + public function getSaveArticleDetail() + { + $data = $this->request->post(); + $rule = new Validate([ + 'article_id' => 'require' + ]); + if (!$rule->check($data)) { + return jsonError($rule->getError()); + } + $base = $this->article_obj->where('article_id', $data['article_id'])->find(); + $major_info = $this->major_obj->where('major_id', $base['major_id'])->find(); + $major = ''; + if ($major_info['major_level'] == 4) { + $major2 = $this->major_obj->where('major_id', $major_info['pid'])->find(); + $major2['child'] = $major_info; + $major = $this->major_obj->where('major_id', $major2['pid'])->find(); + $major['child'] = $major2; + } elseif ($major_info['major_level'] == 3) { + $major1 = $this->major_obj->where('major_id', $major_info['pid'])->find(); + $major1['child'] = $major_info; + $major = $major1; + } else { + $major = $major_info; + } + $authors = $this->article_author_obj->where('article_id', $data['article_id'])->where('state', 0)->select(); + $files = $this->article_file_obj->where('article_id', $data['article_id'])->where('state', 0)->select(); + $re['base'] = $base; + $re['authors'] = $authors; + $re['files'] = $files; + $re['major'] = $major; + return jsonSuccess($re); + } + + /** + * 添加文章第一部分 + */ + public function addArticlePart1() + { + $data = $this->request->post(); + $rule = new Validate([ + 'article_id' => 'require', + 'user_id' => 'require', + 'journal' => 'require', + 'title' => 'require', + 'type' => 'require', + 'major' => 'require', + 'abstrart' => 'require' + ]); + if (!$rule->check($data)) { + return jsonError($rule->getError()); + } + $user_info = $this->user_obj->where('user_id', $data['user_id'])->find(); + $journal_info = $this->journal_obj->where('journal_id', $data['journal'])->find(); + $article_id = $data['article_id']; + //添加文章基础信息 + if ($data['article_id'] == 0) { + $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!']); + } + } + + $inset_data['user_id'] = $user_info['user_id']; + $inset_data['journal_id'] = $data['journal']; + $inset_data['editor_id'] = $journal_info['editor_id']; + $inset_data['title'] = trim($data['title']); + $inser_data['abstrart'] = trim($data['abstrart']); + $inset_data['keywords'] = isset($data['keyWords']) ? $data['keyWords'] : ''; + $inset_data['fund'] = isset($data['fund']) ? trim($data['fund']) : ''; + $inset_data['accept_sn'] = getArticleSN($journal_info['abbr'], $data['type']); + $inset_data['type'] = $data['type']; + $inset_data['major_id'] = $data['major']; + $inset_data['ctime'] = time(); + $inset_data['state'] = -1; + $article_id = $this->article_obj->insertGetId($inset_data); + } else { + $up['user_id'] = $user_info['user_id']; + $up['journal_id'] = $data['journal']; + $up['editor_id'] = $journal_info['editor_id']; + $up['title'] = trim($data['title']); + $up['abstrart'] = trim($data['abstrart']); + $up['keywords'] = isset($data['keyWords']) ? $data['keyWords'] : ''; + $up['fund'] = isset($data['fund']) ? trim($data['fund']) : ''; + $up['type'] = $data['type']; + $up['major_id'] = $data['major']; + $this->article_obj->where('article_id', $article_id)->update($up); + } + + return jsonSuccess(['article_id' => $article_id]); + } + + /** + * 保存文章作者 + */ + public function saveArticleAuthor() + { + $data = $this->request->post(); + $rule = new Validate([ + 'article_id' => 'require', + 'authors' => 'require|array' + ]); + if (!$rule->check($data)) { + return jsonError($rule->getError()); + } + $article_info = $this->article_obj->where('article_id', $data['article_id'])->find(); + $has_authors = $this->article_author_obj->where('article_id', $data['article_id'])->where('state', 0)->select(); + + Db::startTrans(); + $insert_res = true; + foreach ($data['authors'] as $k => $v) { + if ($v['art_aut_id'] == 0) { //add + $i['article_id'] = $data['article_id']; + $i['firstname'] = trim($v['firstname']); + $i['lastname'] = trim($v['lastname']); + $i['orcid'] = isset($v['orcid']) ? $v['orcid'] : ''; + $i['company'] = isset($v['company']) ? $v['company'] : ''; + $i['department'] = isset($v['department']) ? $v['department'] : ''; + $i['author_title'] = isset($v['title']) ? $v['title'] : ''; + $i['country'] = $v['country']; + $i['email'] = trim($v['email']); + $i['address'] = isset($v['address']) ? $v['address'] : ''; + $i['is_super'] = $v['isSuper'] == 'true' ? 1 : 0; + $i['is_report'] = $v['isReport'] == 'true' ? 1 : 0; + $add_res = $this->article_author_obj->insert($i); + if (!$add_res) { + $insert_res = false; + break; + } + } else { //edit + $u['article_id'] = $data['article_id']; + $u['firstname'] = trim($v['firstname']); + $u['lastname'] = trim($v['lastname']); + $u['orcid'] = isset($v['orcid']) ? $v['orcid'] : ''; + $u['company'] = isset($v['company']) ? $v['company'] : ''; + $u['department'] = isset($v['department']) ? $v['department'] : ''; + $u['author_title'] = isset($v['title']) ? $v['title'] : ''; + $u['country'] = $v['country']; + $u['email'] = trim($v['email']); + $u['address'] = isset($v['address']) ? $v['address'] : ''; + $u['is_super'] = $v['isSuper'] == 'true' ? 1 : 0; + $u['is_report'] = $v['isReport'] == 'true' ? 1 : 0; + $this->article_author_obj->where('art_aut_id', $v['art_aut_id'])->update($u); + + //去掉已存在的项 + foreach ($has_authors as $key => $val) { + if ($val['art_aut_id'] == $v['art_aut_id']) { + unset($has_authors[$key]); + } + } + } + } + if ($insert_res) { + foreach ($has_authors as $v) { + $this->article_author_obj->where('art_aut_id', $v['art_aut_id'])->update(['state' => 1]); + } + } + if ($insert_res) { + Db::commit(); + return jsonSuccess([]); + } else { + Db::rollback(); + return jsonError("system error!"); + } + } + + + + /** + * 添加文章文件 + */ + public function addArticlefile() + { + $data = $this->request->post(); + $rule = new Validate([ + 'article_id' => 'require', + 'type' => 'require', + 'url' => 'require' + ]); + 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(); + $file_id = self::save_article_file($data['article_id'], $article_info['user_id'], $user_info['account'], $data['url'], $data['type']); + $re['file_id'] = $file_id; + return jsonSuccess($re); + } + + + public function delArticleFile() + { + $data = $this->request->post(); + $rule = new Validate([ + 'file_id' => 'require' + ]); + if (!$rule->check($data)) { + return jsonError($rule->getError()); + } + $this->article_file_obj->where('file_id', $data['file_id'])->update(['state' => 1]); + return jsonSuccess([]); + } + + /** + * 删除 + */ + public function delSaveArticle() + { + $data = $this->request->post(); + $rule = new Validate([ + 'article_id' => 'require' + ]); + if (!$rule->check($data)) { + return jsonError($rule->getError()); + } + $this->article_obj->where('article_id', $data['article_id'])->update(['state' => 3]); + return jsonSuccess([]); + } + + /** + * 添加文章最终 + */ + public function addArticlePart4() + { + $data = $this->request->post(); + $rule = new Validate([ + 'article_id' => 'require', + 'istransfer' => 'require' + ]); + if (!$rule->check($data)) { + return jsonError($rule->getError()); + } + $article_info = $this->article_obj->where('article_id', $data['article_id'])->find(); + $journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find(); + $user_res = $this->user_obj->where('user_id', $article_info['user_id'])->find(); + + $author_email = []; + + $authors = $this->article_author_obj->where('article_id', $data['article_id'])->select(); + foreach ($authors as $k => $v) { + $cache['email'] = trim($v['email']); + $cache['name'] = trim($v['firstname']) . ' ' . trim($v['lastname']); + $author_email[] = $cache; + if ($v['is_report'] == "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['ctime'] = time(); + $this->user_obj->insertGetId($inser_data); + + //发送提示邮件给通讯作者 + $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']; + $maidata['email'] = trim($v['email']); + $maidata['title'] = $journal_info['title']; + $maidata['content'] = $report_tt; + $maidata['tmail'] = $journal_info['email']; + $maidata['tpassword'] = $journal_info['epassword']; + Queue::push('app\api\job\mail@fire', $maidata, "tmail"); + } + } + } + + //增加转投信息 + $transr = true; + if ($data['istransfer'] == 'true') { + foreach ($data['checkedjours'] as $val) { + $trans_insert['article_id'] = $data['article_id']; + $trans_insert['journal_id'] = $val; + $trans_insert['ctime'] = time(); + $transr = $transr ? $this->article_transfer_obj->insert($trans_insert) : false; + } + } + + //发送邮件到编辑,提醒有待审文章 + $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(); + //发送邮件给作者,表示感谢 + $tt_t = 'Dear Dr. ' . ($user_res['realname'] == '' ? $user_res['account'] : $user_res['realname']) . ',

'; + $tt1 = 'Thank you for submitting your manuscript entitled "' . $article_info['title'] . '". Your submission has been assigned the following tracking number:' . $article_info['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'] . '.


'; + $tt1 .= 'Sincerely,
Editorial Office
'; + $tt1 .= 'Subscribe to this journal
'; + $tt1 .= $journal_info['title'] . '
'; + $tt1 .= 'Email: ' . $journal_info['email'] . '
'; + $tt1 .= 'Website: ' . $journal_info['website'] . '
'; + $tt1 .= '
If you have any questions, please contact us:
'; + $tt1 .= 'Head of publication ethics
Dr. Dan Chen
TMR Publishing Group Limited Company, Auckland, New Zealand
Email: publication.ethics@tmrjournals.com'; + } + + sendEmail($user_res['email'], $journal_info['title'], $journal_info['title'], $tt_t . $tt1, $journal_info['email'], $journal_info['epassword']); + + foreach ($author_email as $v) { + $cache_str = 'Dear Dr. ' . $v['name'] . ',

'; + $maidata['email'] = $v['email']; + $maidata['title'] = $journal_info['title']; + $maidata['content'] = $cache_str . $tt1; + $maidata['tmail'] = $journal_info['email']; + $maidata['tpassword'] = $journal_info['epassword']; + Queue::push('app\api\job\mail@fire', $maidata, "tmail"); + } + + //增加用户操作log + $log_data['user_id'] = $user_res['user_id']; + $log_data['type'] = 0; + $log_data['content'] = $user_res['account'] . "(" . $user_res['realname'] . "),上传了一篇文章:" . $data['title'] . ",上传时间是:" . date('Y-m-d H:i:s', time()); + $log_data['ctime'] = time(); + $res_log = $this->user_log_obj->insert($log_data); + + //增加usermsg + $res_msg = add_usermsg($journal_info['editor_id'], 'New manuscript', '/articleDetailEditor?id=' . $data['article_id']); + + //通讯作者转为审稿人 + $this->addReviewerFromArticle($data['article_id'], $journal_info['journal_id']); + + //推荐审稿人 + $reviewers = isset($data['reviewers']) ? $data['reviewers'] : []; + foreach ($reviewers as $v) { + $this->addRecommentReviewer($v, $journal_info['journal_id'], $user_res['user_id'], $data['article_id']); + } + $this->article_obj->where('article_id', $data['article_id'])->update(['state' => 0]); + $this->ai_scor($data['article_id']); + return json(['code' => 0]); + } + // public function ffff(){ // $data = $this->request->post(); // $this->ai_scor($data['article_id']); @@ -1737,79 +2197,81 @@ class Article extends Controller { /** * 获取文章通讯作者信息 */ - public function getArticleReport(){ + public function getArticleReport() + { $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()); } - $reports = $this->article_author_obj->where('article_id',$data['article_id'])->where('is_report',1)->select(); - foreach($reports as $k => $v){ - $ca=$this->user_obj->where('email',$v['email'])->find(); + $reports = $this->article_author_obj->where('article_id', $data['article_id'])->where('is_report', 1)->select(); + foreach ($reports as $k => $v) { + $ca = $this->user_obj->where('email', $v['email'])->find(); $reports[$k]['account'] = $ca; } $re['reports'] = $reports; return jsonSuccess($re); } - public function editHindexAndScor(){ + public function editHindexAndScor() + { $data = $this->request->post(); $rule = new Validate([ - 'article_id'=>'require', - 'email'=>'require', - 'Hindex'=>'require', - 'editor_id'=>'require' + 'article_id' => 'require', + 'email' => 'require', + 'Hindex' => 'require', + 'editor_id' => 'require' ]); - if(!$rule->check($data)){ + if (!$rule->check($data)) { return jsonError($rule->getError()); } - $editor_info = $this->user_obj->where('user_id',$data['editor_id'])->find(); + $editor_info = $this->user_obj->where('user_id', $data['editor_id'])->find(); - $updata['google_index']=$data['Hindex']; + $updata['google_index'] = $data['Hindex']; $updata['google_time'] = time(); $updata['google_editor'] = $editor_info['realname']; - $this->user_obj->where('email',$data['email'])->update($updata); + $this->user_obj->where('email', $data['email'])->update($updata); $this->ai_scor($data['article_id']); return jsonSuccess([]); - } /** * 人工智能打分 */ - public function ai_scor($article_id){ - $article_info = $this->article_obj->where('article_id',$article_id)->find(); - $files = $this->article_file_obj->where('article_id',$article_id)->where('type_name','manuscirpt') - ->order('ctime desc') - ->limit(1) - ->select(); + public function ai_scor($article_id) + { + $article_info = $this->article_obj->where('article_id', $article_id)->find(); + $files = $this->article_file_obj->where('article_id', $article_id)->where('type_name', 'manuscirpt') + ->order('ctime desc') + ->limit(1) + ->select(); - $authors = $this->article_author_obj->where('article_id',$article_id)->where('is_report',1)->where('state',0)->select(); + $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(); $fen = 0; //h指数分数 $h_fen = 0; - if($user_info['google_index']>=20){ + if ($user_info['google_index'] >= 20) { $h_fen = 4; - }elseif($user_info['google_index']>=6){ + } elseif ($user_info['google_index'] >= 6) { $h_fen = 3; - }elseif($user_info['google_index']>=2){ + } elseif ($user_info['google_index'] >= 2) { $h_fen = 1; - }else{ + } else { $h_fen = 0; } $fen += $h_fen; @@ -1819,62 +2281,69 @@ class Article extends Controller { $url = "http://ts.tmrjournals.com/api/typeset/readPic"; $program['fileRoute'] = "https://submission.tmrjournals.com/public/" . $files[0]['file_url']; $res = object_to_array(json_decode(myPost($url, $program))); - $wp = $res['data']; + $wp = isset($res['data']['pic']) ? $res['data']['pic'] : 0; + $tp = isset($res['data']['table']) ? $res['data']['table'] : 0; - $pics = $this->article_file_obj->where('article_id',$article_id)->where('type_name','picturesAndTables')->select(); + $pics = $this->article_file_obj->where('article_id', $article_id)->where('type_name', 'picturesAndTables')->select(); $np = 0; - foreach($pics as $v){ - $ext = substr(strrchr($v['file_url'],'.'),1); - if($ext=='zip'){ - $cn = $this->readZip(ROOT_PATH . "public".DS.$v['file_url']); + foreach ($pics as $v) { + $ext = substr(strrchr($v['file_url'], '.'), 1); + if ($ext == 'zip') { + $cn = $this->readZip(ROOT_PATH . "public" . DS . $v['file_url']); $np += $cn; - }else{ - $np++; + } else { + $np++; } } - $p_num = $wp>$np?$wp:$np; + $p_num = $wp > $np ? $wp : $np; - if($p_num>3){ + $all_num = $p_num + $tp; + if ($all_num > 3) { $b_fen = 2; - }elseif($p_num>=1){ + } elseif ($all_num >= 1) { $b_fen = 1; - }else{ + } else { $b_fen = 0; } $fen += $b_fen; //国家 $c_fen = 0; - $author = $this->article_author_obj->where('article_id',$article_id)->where('is_report',1)->find(); - if($author['country']!=""){ - $coun = $this->country_obj->where('en_name',$author['country'])->find(); - if($coun&&$coun['is_hot']==1){ + $author = $this->article_author_obj->where('article_id', $article_id)->where('is_report', 1)->find(); + if ($author['country'] != "") { + $coun = $this->country_obj->where('en_name', $author['country'])->find(); + if ($coun && $coun['is_hot'] == 1) { $c_fen = 1; - $fen+=1; + $fen += 1; } } //单位 $dw_fen = 0; - $report_author = $this->article_author_obj->where('article_id',$article_id)->where('email',$user_info['email'])->find(); - if($report_author){ - $ca_res = $this->company_top_obj->where('title',$report_author['company'])->find(); - if($ca_res){ - $dw_fen = 1.5; - $fen+=1.5; + $report_author = $this->article_author_obj->where('article_id', $article_id)->where('email', $user_info['email'])->find(); + if ($report_author) { + $ca_res = $this->company_top_obj->where('title', $report_author['company'])->find(); + if ($ca_res) { + if ($ca_res['company_id'] <= 100 || ($ca_res['company_id'] > 201 && $ca_res['company_id'] <= 301)) { + $dw_fen = 1.5; + $fen += 1.5; + } else { + $dw_fen = 1; + $fen += 1; + } } } //领域 $ly_fen = 0; - $m = $this->major_obj->where('major_id',$article_info['major_id'])->find(); - if($m['is_hot']==1){ + $m = $this->major_obj->where('major_id', $article_info['major_id'])->find(); + if ($m['is_hot'] == 1) { $ly_fen = 1; $fen += 1; } //基金 $jj_fen = 0; - if(strlen($article_info['fund'])>15){ + if (strlen($article_info['fund']) > 10) { $jj_fen = 0.5; $fen += 0.5; } @@ -1887,14 +2356,16 @@ class Article extends Controller { $updata['ly_fen'] = $ly_fen; $updata['jj_fen'] = $jj_fen; - $this->article_obj->where('article_id',$article_id)->update($updata); + $this->article_obj->where('article_id', $article_id)->update($updata); + return jsonSuccess([]); } - private function readZip($file){ + private function readZip($file) + { $zip = new \ZipArchive(); - if($zip->open($file)===true){ + if ($zip->open($file) === true) { return $zip->numFiles; - }else{ + } else { return 0; } } @@ -1902,8 +2373,9 @@ class Article extends Controller { /** * 添加推荐审稿人 */ - public function addRecommentReviewer($reivewe,$journal_id,$user_id,$article_id){ - $journal_info = $this->journal_obj->where('journal_id',$journal_id)->find(); + public function addRecommentReviewer($reivewe, $journal_id, $user_id, $article_id) + { + $journal_info = $this->journal_obj->where('journal_id', $journal_id)->find(); //判断此用户是否存在 $reviewer_info = $this->user_obj->where('email', trim($reivewe['email']))->where('state', 0)->find(); if ($reviewer_info == null) { //添加用户 @@ -1950,7 +2422,7 @@ class Article extends Controller { return false; } } - + /** * @title 获取待审文章 * @description 获取待审文章 @@ -1961,15 +2433,16 @@ class Article extends Controller { * * @return articles:待审稿件# */ - public function getReviewerArticles(){ + public function getReviewerArticles() + { $list = $this->article_obj - ->field('t_article.*,t_journal.title journalname') - ->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'LEFT') - ->where('t_article.state',2)->where("CHAR_LENGTH(t_article.title)=LENGTH(t_article.title)")->limit(3)->select(); + ->field('t_article.*,t_journal.title journalname') + ->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'LEFT') + ->where('t_article.state', 2)->where("CHAR_LENGTH(t_article.title)=LENGTH(t_article.title)")->limit(3)->select(); $re['articles'] = $list; return jsonSuccess($re); } - + /** * @title 获取待审文章 * @description 获取待审文章 @@ -1981,92 +2454,95 @@ class Article extends Controller { * * @return articles:待审稿件# */ - public function getReviewerArticlesForJournal(){ + public function getReviewerArticlesForJournal() + { $data = $this->request->post(); - $journal_info = $this->journal_obj->where('issn',$data['issn'])->find(); + $journal_info = $this->journal_obj->where('issn', $data['issn'])->find(); $list = $this->article_obj - ->field('t_article.*,t_journal.title journalname') - ->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'LEFT') - ->where('t_article.state',2)->where('t_article.journal_id',$journal_info['journal_id']) - ->where("(t_journal.journal_id = 21) or (length(t_article.title) = CHARACTER_LENGTH(t_article.title))") - ->limit(3)->select(); + ->field('t_article.*,t_journal.title journalname') + ->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'LEFT') + ->where('t_article.state', 2)->where('t_article.journal_id', $journal_info['journal_id']) + ->where("(t_journal.journal_id = 21) or (length(t_article.title) = CHARACTER_LENGTH(t_article.title))") + ->limit(3)->select(); $re['articles'] = $list; return jsonSuccess($re); } - - - -// public function cfreviewer(){ -// $list = $this->article_author_obj->where("is_report",1)->select(); -// foreach ($list as $v){ -// $ar = $this->article_obj->where("article_id",$v['article_id'])->find(); -// if(!$ar){ -// continue; -// } -// $this->addReviewerFromReportAuthor($v['art_aut_id'], $ar['journal_id']); -// } -// echo 'ok'; -// } - - - private function addReviewerFromArticle($article_id,$journal_id){ - $list = $this->article_author_obj->where('article_id',$article_id)->where('is_report',1)->where('state',0)->select(); - foreach ($list as $v){ + + + + // public function cfreviewer(){ + // $list = $this->article_author_obj->where("is_report",1)->select(); + // foreach ($list as $v){ + // $ar = $this->article_obj->where("article_id",$v['article_id'])->find(); + // if(!$ar){ + // continue; + // } + // $this->addReviewerFromReportAuthor($v['art_aut_id'], $ar['journal_id']); + // } + // echo 'ok'; + // } + + + private function addReviewerFromArticle($article_id, $journal_id) + { + $list = $this->article_author_obj->where('article_id', $article_id)->where('is_report', 1)->where('state', 0)->select(); + foreach ($list as $v) { $this->addReviewerFromReportAuthor($v['art_aut_id'], $journal_id); } } - + /** * 添加审稿人来自通讯作者 */ - private function addReviewerFromReportAuthor($art_aut_id,$journal_id){ - $journal_info = $this->journal_obj->where('journal_id',$journal_id)->find(); + private function addReviewerFromReportAuthor($art_aut_id, $journal_id) + { + $journal_info = $this->journal_obj->where('journal_id', $journal_id)->find(); //判断通讯作者信息是否合规 - $author_info = $this->article_author_obj->where('art_aut_id',$art_aut_id)->find(); - if(!preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/",$author_info['email'])){ - return ; + $author_info = $this->article_author_obj->where('art_aut_id', $art_aut_id)->find(); + if (!preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/", $author_info['email'])) { + return; } - - $check = $this->reviewer_from_author_obj->where('art_aut_id',$art_aut_id)->where('journal_id',$journal_id)->find(); - if($check){ - return ; + + $check = $this->reviewer_from_author_obj->where('art_aut_id', $art_aut_id)->where('journal_id', $journal_id)->find(); + if ($check) { + return; } - + //判断目前的状态进行下一步流程 - $user_info = $this->user_obj->where('email',$author_info['email'])->where('state',0)->find(); - if($user_info==null){//不存在用户 - + $user_info = $this->user_obj->where('email', $author_info['email'])->where('state', 0)->find(); + if ($user_info == null) { //不存在用户 + //添加用户,发送邮件 $user_insert['account'] = $author_info['email']; $user_insert['password'] = md5("123456qwe"); $user_insert['email'] = $author_info['email']; - $user_insert['realname'] = $author_info['firstname']." ".$author_info['lastname']; + $user_insert['realname'] = $author_info['firstname'] . " " . $author_info['lastname']; $user_insert['ctime'] = time(); $add_user_id = $this->user_obj->insertGetId($user_insert); - + //发送邮件 - $tt = 'Dear Dr. '.$user_insert['realname'].'

'; - $tt .= 'Thank you for submitting your paper to '.$journal_info['title'].' as the corresponding author.
'; + $tt = 'Dear Dr. ' . $user_insert['realname'] . '

'; + $tt .= 'Thank you for submitting your paper to ' . $journal_info['title'] . ' as the corresponding author.
'; $tt .= 'In order to provide a better online experience for authors, we have set up your account in our submission system.

'; $tt .= 'You could log in with your account in https://submission.tmrjournals.com/login
'; - $tt .= 'Your username:'.$author_info['email'].'
'; + $tt .= 'Your username:' . $author_info['email'] . '
'; $tt .= 'Your password:123456qwe (you could change your password in the system by yourself later.)

'; $tt .= 'Thank you so much for your kindly support.

'; - $tt .= 'Sincerely,
Editorial Office
'.$journal_info['title'].'
'; - $tt .= 'Email: '.$journal_info['email'].'
'; - $tt .= 'Website:'.$journal_info['website'].''; + $tt .= 'Sincerely,
Editorial Office
' . $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']); + sendEmail($author_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']); - $sendUser=[ - 'title'=>$journal_info['title'], // 邮件标题 - 'content'=>$tt,//邮件内容 - 'user_id'=>$add_user_id, //收件人ID - 'email'=>$author_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' => $add_user_id, //收件人ID + 'email' => $author_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'); @@ -2075,19 +2551,19 @@ class Article extends Controller { $art_insert['journal_id'] = $journal_id; $art_insert['rfa_ctime'] = time(); $this->reviewer_from_author_obj->insert($art_insert); - return ; + return; } - $reviewer_check = $this->reviewer_to_journal_obj->where('reviewer_id',$user_info['user_id'])->where('state',0)->find(); - $reviewer_this_check = $this->reviewer_to_journal_obj->where('reviewer_id',$user_info['user_id'])->where('journal_id',$journal_id)->where('state',0)->find(); - if($reviewer_check == null){//存在用户但不是审稿人 + $reviewer_check = $this->reviewer_to_journal_obj->where('reviewer_id', $user_info['user_id'])->where('state', 0)->find(); + $reviewer_this_check = $this->reviewer_to_journal_obj->where('reviewer_id', $user_info['user_id'])->where('journal_id', $journal_id)->where('state', 0)->find(); + if ($reviewer_check == null) { //存在用户但不是审稿人 //添加转换表数据 $art_insert['art_aut_id'] = $art_aut_id; $art_insert['journal_id'] = $journal_id; $art_insert['rfa_ctime'] = time(); $this->reviewer_from_author_obj->insert($art_insert); - return ; - }else{ - if($reviewer_this_check==null){ + return; + } else { + if ($reviewer_this_check == null) { //直接添加审稿人 $reviewer_insert['reviewer_id'] = $user_info['user_id']; $reviewer_insert['journal_id'] = $journal_id; @@ -2095,31 +2571,33 @@ class Article extends Controller { $reviewer_insert['journal_title'] = $journal_info['title']; $reviewer_insert['ctime'] = time(); $this->reviewer_to_journal_obj->insert($reviewer_insert); - return ; - }else{ - return ; + return; + } else { + return; } } } - - + + /** * 作者发送消息 */ - public function authorMessage(){ + public function authorMessage() + { $data = $this->request->post(); $insert['article_id'] = $data['articleId']; $insert['content'] = $data['content']; $insert['ftype'] = 1; $insert['ctime'] = time(); $this->article_msg_obj->insert($insert); - return json(['code'=>0]); + return json(['code' => 0]); } /** * 获取期刊列表 */ - public function getJournal() { + public function getJournal() + { $username = $this->request->post('username'); $where = []; if ($username) { @@ -2132,16 +2610,18 @@ class Article extends Controller { /** * 获取期刊列表 */ - public function getJournalOutLx() { + public function getJournalOutLx() + { $editorid = $this->request->post('editor_id'); - $list = $this->journal_obj->where('editor_id',$editorid)->where('journal_id','not in','2,3,15')->select(); + $list = $this->journal_obj->where('editor_id', $editorid)->where('journal_id', 'not in', '2,3,15')->select(); return json($list); } /** * 获取文章历史上传file列表 */ - public function getFilelistByArticleID() { + public function getFilelistByArticleID() + { $article_id = $this->request->post('articleId'); $where['article_id'] = $article_id; $res = $this->article_file_obj->where($where)->select(); @@ -2155,7 +2635,8 @@ class Article extends Controller { /** * 上传文章的文件 */ - public function up_file($type) { + public function up_file($type) + { $file = request()->file($type); if ($file) { $info = $file->move(ROOT_PATH . 'public' . DS . $type); @@ -2166,7 +2647,7 @@ class Article extends Controller { } } } - + /** * @title 上传编辑修回意见文件 * @description 上传编辑修回意见文件 @@ -2178,7 +2659,8 @@ class Article extends Controller { * * @return upurl:图片地址 */ - public function up_proposal_file() { + public function up_proposal_file() + { $file = request()->file('articleProposal'); if ($file) { $info = $file->move(ROOT_PATH . 'public' . DS . 'articleProposal'); @@ -2193,7 +2675,8 @@ class Article extends Controller { /** * 上传作者反馈审稿人文件 */ - public function up_response_file(){ + public function up_response_file() + { $file = request()->file('articleResponse'); if ($file) { $info = $file->move(ROOT_PATH . 'public' . DS . 'articleResponse'); @@ -2208,19 +2691,20 @@ class Article extends Controller { /** * 编辑获取连续出刊列表 */ - public function getContinuityJournals(){ + public function getContinuityJournals() + { $data = $this->request->post(); $rule = new Validate([ - 'editor_id'=>'require' + 'editor_id' => 'require' ]); - if(!$rule->check($data)){ + if (!$rule->check($data)) { return jsonError($rule->getError()); } - $res = $this->user_obj->where('user_id',$data['editor_id'])->find(); - if(!$res){ + $res = $this->user_obj->where('user_id', $data['editor_id'])->find(); + if (!$res) { return jsonError('no this user!'); } - $journals = $this->journal_obj->where('editor_id',$res['user_id'])->where('journal_id','in','2,3,15')->select(); + $journals = $this->journal_obj->where('editor_id', $res['user_id'])->where('journal_id', 'in', '2,3,15')->select(); $re['journals'] = $journals; return jsonSuccess($re); } @@ -2229,16 +2713,17 @@ class Article extends Controller { /** * 获取文章审稿实例列表 */ - public function getReviewerList() { + public function getReviewerList() + { $data = $this->request->post(); $limit_start = ($data['pageIndex'] - 1) * $data['pageSize']; $where['t_article_reviewer.article_id'] = $data['articleId']; $res = $this->article_reviewer_obj - ->field('t_article_reviewer.*,t_user.email,t_user.realname,t_user.account reviewer,t_user_reviewer_info.country country,t_user_reviewer_info.field,t_user_reviewer_info.company,t_reviewer_major.title major_title,t_reviewer_major.ctitle major_ctitle') - ->join('t_user', 't_article_reviewer.reviewer_id = t_user.user_id', 'LEFT') - ->join('t_user_reviewer_info', 't_article_reviewer.reviewer_id = t_user_reviewer_info.reviewer_id', 'LEFT') - ->join('t_reviewer_major', 't_reviewer_major.major_id = t_user_reviewer_info.major', 'LEFT') - ->where($where)->limit($limit_start, $data['pageSize'])->select(); + ->field('t_article_reviewer.*,t_user.email,t_user.realname,t_user.account reviewer,t_user_reviewer_info.country country,t_user_reviewer_info.field,t_user_reviewer_info.company,t_reviewer_major.title major_title,t_reviewer_major.ctitle major_ctitle') + ->join('t_user', 't_article_reviewer.reviewer_id = t_user.user_id', 'LEFT') + ->join('t_user_reviewer_info', 't_article_reviewer.reviewer_id = t_user_reviewer_info.reviewer_id', 'LEFT') + ->join('t_reviewer_major', 't_reviewer_major.major_id = t_user_reviewer_info.major', 'LEFT') + ->where($where)->limit($limit_start, $data['pageSize'])->select(); @@ -2249,101 +2734,108 @@ class Article extends Controller { return json(['code' => 1]); } } - + /** * 根据期刊别名获取期刊信息 */ - public function getJournalByAlias(){ + public function getJournalByAlias() + { //接收参数 $data = $this->request->post(); - $res = $this->journal_obj->where('alias',$data['alias'])->find(); + $res = $this->journal_obj->where('alias', $data['alias'])->find(); return json($res); } /** * 获取审核人详情 */ - public function getReviewerdetail() { + public function getReviewerdetail() + { $uid = $this->request->post('uid'); $res = $this->user_obj->field('t_user.*,t_user_reviewer_info.*,t_reviewer_major.title major_title') - ->join('t_user_reviewer_info', 't_user.user_id = t_user_reviewer_info.reviewer_id', 'LEFT') - ->join('t_reviewer_major', 't_reviewer_major.major_id = t_user_reviewer_info.major', 'LEFT') - ->where('t_user.user_id', $uid)->find(); + ->join('t_user_reviewer_info', 't_user.user_id = t_user_reviewer_info.reviewer_id', 'LEFT') + ->join('t_reviewer_major', 't_reviewer_major.major_id = t_user_reviewer_info.major', 'LEFT') + ->where('t_user.user_id', $uid)->find(); return json(['code' => 0, 'data' => $res]); } /** * 获取文章审核员list */ - public function getArticleReviewerList() { + public function getArticleReviewerList() + { $data = $this->request->post(); - + $article_info = $this->article_obj->where('article_id', $data['articleId'])->find(); -// $revids = $this->reviewer_to_journal_obj->where('journal_id', $article_info['journal_id'])->where('state',0)->column('reviewer_id'); + // $revids = $this->reviewer_to_journal_obj->where('journal_id', $article_info['journal_id'])->where('state',0)->column('reviewer_id'); $noids = $this->article_reviewer_obj->where('article_id', $data['articleId'])->column('reviewer_id'); $noids[] = $article_info['user_id']; - - $res = $this->reviewer_to_journal_obj - ->field('t_user.user_id,t_user.account') - ->join('t_user','t_user.user_id = t_reviewer_to_journal.reviewer_id','left') - ->join('t_user_reviewer_info', 't_user.user_id = t_user_reviewer_info.reviewer_id', 'LEFT') - ->where('t_reviewer_to_journal.journal_id',$article_info['journal_id']) - ->where('t_user.user_id','not in',$noids) - ->where('t_user.state',0) - ->select(); - -// if ($noids != null) { -// $where['t_user.user_id'] = [['in', $revids], ['not in', $noids]]; -// } else { -// $where['t_user.user_id'] = ['in', $revids]; -// } -// $where['t_user.state'] = 0; -// $res = $this->user_obj->field('t_user.*,t_user_reviewer_info.*') -// ->join('t_user_reviewer_info', 't_user.user_id = t_user_reviewer_info.reviewer_id', 'LEFT') -// ->where($where) -// ->select(); -// -// echo $this->user_obj->getLastSql(); -// die; + $res = $this->reviewer_to_journal_obj + ->field('t_user.user_id,t_user.account') + ->join('t_user', 't_user.user_id = t_reviewer_to_journal.reviewer_id', 'left') + ->join('t_user_reviewer_info', 't_user.user_id = t_user_reviewer_info.reviewer_id', 'LEFT') + ->where('t_reviewer_to_journal.journal_id', $article_info['journal_id']) + ->where('t_user.user_id', 'not in', $noids) + ->where('t_user.state', 0) + ->select(); + + + // if ($noids != null) { + // $where['t_user.user_id'] = [['in', $revids], ['not in', $noids]]; + // } else { + // $where['t_user.user_id'] = ['in', $revids]; + // } + // $where['t_user.state'] = 0; + // $res = $this->user_obj->field('t_user.*,t_user_reviewer_info.*') + // ->join('t_user_reviewer_info', 't_user.user_id = t_user_reviewer_info.reviewer_id', 'LEFT') + // ->where($where) + // ->select(); + // + // echo $this->user_obj->getLastSql(); + // die; if ($res) { return json(['code' => 0, 'data' => $res]); } else { return json(['code' => 1]); } } - + /** * 获取文章数通过期刊issn号 */ - public function getArticleForJournal(){ + public function getArticleForJournal() + { $data = $this->request->post(); - $journal_info = $this->journal_obj->where('issn',$data['issn'])->find(); + $journal_info = $this->journal_obj->where('issn', $data['issn'])->find(); $list = $this->article_obj - ->where('journal_id',$journal_info['journal_id']) - ->where('state','in','0,1,2,4') -// ->where('ctime','>',$data['ctime']) - ->select(); - + ->where('journal_id', $journal_info['journal_id']) + ->where('state', 'in', '0,1,2,4') + // ->where('ctime','>',$data['ctime']) + ->select(); + $re['articles'] = $list; return jsonSuccess($re); } + + /** * 存储article文件历史信息 */ - private function save_article_file($article_id, $user_id, $username, $url, $type_name) { + private function save_article_file($article_id, $user_id, $username, $url, $type_name) + { //首先确定数据库里面是否存在此数据 $res = $this->article_file_obj->where(['file_url' => $url])->find(); - if ($res) {//编辑的时候不能重复存储 + if ($res) { //编辑的时候不能重复存储 return true; - }else if($type_name=='picturesAndTables' && trim($url) == ''){ + } else if ($type_name == 'picturesAndTables' && trim($url) == '') { return true; - }else if($type_name=='coverLetter' && trim($url) == ''){ + } else if ($type_name == 'coverLetter' && trim($url) == '') { return true; - }else if($type_name=='totalpage' && trim($url) == ''){ + } else if ($type_name == 'totalpage' && trim($url) == '') { return true; } $insert_data['article_id'] = $article_id; @@ -2352,121 +2844,121 @@ class Article extends Controller { $insert_data['file_url'] = $url; $insert_data['type_name'] = $type_name; $insert_data['ctime'] = time(); - return $this->article_file_obj->insert($insert_data); + return $this->article_file_obj->insertGetId($insert_data); } - + /** * 获取文章作者字符串 * @param type $article_id */ - public function getArticleAuthors($article_id){ - $res = $this->article_author_obj->where('article_id',$article_id)->where('state',0)->select(); + public function getArticleAuthors($article_id) + { + $res = $this->article_author_obj->where('article_id', $article_id)->where('state', 0)->select(); $frag = ''; - foreach ($res as $v){ - $frag .= $v['firstname'].$v['lastname'].','; + foreach ($res as $v) { + $frag .= $v['firstname'] . $v['lastname'] . ','; } - return substr($frag, 0,-1); + return substr($frag, 0, -1); } // 给审稿人发送邮件- 稿件的基本情况 - public function sendEmailToReviewer($articleId,$state){ - //articleId = 1037; - //$state = 3; - $resState = $state==3?"Reject":"Accept"; + public function sendEmailToReviewer($articleId, $state) + { + //articleId = 1037; + //$state = 3; + $resState = $state == 3 ? "Reject" : "Accept"; $allArticleReviewer = $this->article_reviewer_obj->field('t_user.email,t_user.realname,t_article_reviewer.reviewer_id,t_article_reviewer_question.recommend,t_article_reviewer_question.comments') - ->join('t_article_reviewer_question','t_article_reviewer_question.art_rev_id = t_article_reviewer.art_rev_id','LEFT') - ->join('t_user','t_user.user_id = t_article_reviewer.reviewer_id','LEFT') - ->where('t_article_reviewer.article_id',$articleId) - ->where('t_article_reviewer.state','in',[1,2,3]) + ->join('t_article_reviewer_question', 't_article_reviewer_question.art_rev_id = t_article_reviewer.art_rev_id', 'LEFT') + ->join('t_user', 't_user.user_id = t_article_reviewer.reviewer_id', 'LEFT') + ->where('t_article_reviewer.article_id', $articleId) + ->where('t_article_reviewer.state', 'in', [1, 2, 3]) ->select(); // 根据文章ID查询journal_id $journalInfo = $this->article_obj->field('t_journal.journal_id,t_journal.title,t_journal.email,t_journal.epassword') - ->join('t_journal','t_journal.journal_id = t_article.journal_id','LEFT') - ->where('t_article.article_id',$articleId) + ->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'LEFT') + ->where('t_article.article_id', $articleId) ->find(); // 文章信息 - $articleInfo = $this->article_obj->where('article_id',$articleId)->find(); - $pushData=[ - 'title'=>$journalInfo['title'], // 邮件标题 - 'journal_id'=>$journalInfo['journal_id'], // 期刊ID - 'sendEmail'=>$journalInfo['email'], // 期刊邮箱 - 'sendPassword'=>$journalInfo['epassword'], // 期刊密码 - 'from_name'=>$journalInfo['title'] + $articleInfo = $this->article_obj->where('article_id', $articleId)->find(); + $pushData = [ + 'title' => $journalInfo['title'], // 邮件标题 + 'journal_id' => $journalInfo['journal_id'], // 期刊ID + 'sendEmail' => $journalInfo['email'], // 期刊邮箱 + 'sendPassword' => $journalInfo['epassword'], // 期刊密码 + 'from_name' => $journalInfo['title'] ]; $difference = "Please check the final decision of the manuscript you reviewed.

Dear Reviewer,
"; - $difference .= "The final decision of the manuscript ".'"' . $articleInfo['accept_sn']. '"' ." is ".'"'.$resState. '"' .".

"; + $difference .= "The final decision of the manuscript " . '"' . $articleInfo['accept_sn'] . '"' . " is " . '"' . $resState . '"' . ".

"; $difference .= "We sincerely appreciate the time you spent reading and commenting on manuscripts, and we are very grateful for your willingness to serve in this role. Although final decisions are always editorial,the reviewers bring to our deliberations scientific insights, and passion.

"; - $difference .="We note that the final decision is contrary to your decision.
You deserve to know all peer review decisions and comments following as peer reviewer:
"; + $difference .= "We note that the final decision is contrary to your decision.
You deserve to know all peer review decisions and comments following as peer reviewer:
"; - $recommend=[ - 1=>'Accept with minor changes', - 2=>'Accept subject to revisions, as noted in comments', - 3=>'Reject in current form, but may be resubmitted', - 4=>'Reject, with no resubmission', + $recommend = [ + 1 => 'Accept with minor changes', + 2 => 'Accept subject to revisions, as noted in comments', + 3 => 'Reject in current form, but may be resubmitted', + 4 => 'Reject, with no resubmission', ]; $all = "Please check the final decision of the manuscript you reviewed.

Dear Reviewer,
"; - $all .= "The final decision of the manuscript ".'"' . $articleInfo['accept_sn']. '"' ." is ".'"'.$resState. '"' .".

"; + $all .= "The final decision of the manuscript " . '"' . $articleInfo['accept_sn'] . '"' . " is " . '"' . $resState . '"' . ".

"; $all .= "We sincerely appreciate the time you spent reading and commenting on manuscripts, and we are very grateful for your willingness to serve in this role. Although final decisions are always editorial,the reviewers bring to our deliberations scientific insights, and passion.

"; $all .= "Please let us know your feedback at publisher@tmrjournals.com."; - foreach ($allArticleReviewer as $k => $value){ + foreach ($allArticleReviewer as $k => $value) { // 最终意见发给全部审稿人 $pushData['content'] = $all; $pushData['user_id'] = $value['reviewer_id']; - $pushData['email'] =$value['email']; + $pushData['email'] = $value['email']; // Queue::push('app\api\job\domail@fire',$pushData,'domail'); $num = $value['recommend']; - if($value['comments']!=''){ - $difference.= "
Reviewer ". ($k+1).' : '.$recommend[$num] ." ( ".preg_replace("/\t/","",$value['comments'])." )
"; - }else{ - $difference.= "
Reviewer ". ($k+1).' : '.$recommend[$num] ."
"; + if ($value['comments'] != '') { + $difference .= "
Reviewer " . ($k + 1) . ' : ' . $recommend[$num] . " ( " . preg_replace("/\t/", "", $value['comments']) . " )
"; + } else { + $difference .= "
Reviewer " . ($k + 1) . ' : ' . $recommend[$num] . "
"; } } $difference .= "

Please let us know your feedback at publisher@tmrjournals.com."; // 分歧稿件 - foreach ($allArticleReviewer as $k => $value){ + foreach ($allArticleReviewer as $k => $value) { $pushData['content'] = $difference; $pushData['user_id'] = $value['reviewer_id']; - $pushData['email'] =$value['email']; - if($state == 3 && ($value['recommend'] == 1 || $value['recommend'] == 2)){ + $pushData['email'] = $value['email']; + if ($state == 3 && ($value['recommend'] == 1 || $value['recommend'] == 2)) { // Queue::push('app\api\job\domail@fire',$pushData,'domail'); } - if($state == 5 && ($value['recommend'] == 3 || $value['recommend'] == 4)){ + if ($state == 5 && ($value['recommend'] == 3 || $value['recommend'] == 4)) { // Queue::push('app\api\job\domail@fire',$pushData,'domail'); } } - } /** * 留言板留言文章显示红点并发送邮件 * @param $article_id * @param $user_id */ - private function messageTips($article_id,$user_id){ + private function messageTips($article_id, $user_id) + { $article = $this->article_obj->field('t_article.user_id,t_article.editor_id,t_article.accept_sn,t_journal.journal_id,t_journal.title,t_journal.email,t_journal.epassword') - ->join('t_journal','t_journal.journal_id = t_article.journal_id','LEFT') - ->where('t_article.article_id',$article_id) + ->join('t_journal', 't_journal.journal_id = t_article.journal_id', 'LEFT') + ->where('t_article.article_id', $article_id) ->find(); // 判断提交留言人的身份 - $res = $this->user_obj->where('user_id',$user_id)->find(); - if($res['type'] == 1 ){ // 作者 - 修改author_act,并发送给编辑发邮件 - $this->article_obj->where('article_id',$article_id)->update(['author_act'=>1]); - $editor = $this->user_obj->where('user_id',$article['editor_id'])->find(); + $res = $this->user_obj->where('user_id', $user_id)->find(); + if ($res['type'] == 1) { // 作者 - 修改author_act,并发送给编辑发邮件 + $this->article_obj->where('article_id', $article_id)->update(['author_act' => 1]); + $editor = $this->user_obj->where('user_id', $article['editor_id'])->find(); // 发邮件 $content = 'Dear editor,
please check the new feedback.'; - sendEmail($editor['email'],$article['title'],$article['title'],$content,$article['email'],$article['epassword']); + sendEmail($editor['email'], $article['title'], $article['title'], $content, $article['email'], $article['epassword']); } - if($res['type'] == 2 ){ //编辑 - 修改editor_act,并发送给作者发邮件 - $this->article_obj->where('article_id',$article_id)->update(['editor_act'=>1]); - $author = $this->user_obj->where('user_id',$article['user_id'])->find(); + if ($res['type'] == 2) { //编辑 - 修改editor_act,并发送给作者发邮件 + $this->article_obj->where('article_id', $article_id)->update(['editor_act' => 1]); + $author = $this->user_obj->where('user_id', $article['user_id'])->find(); // 发邮件 - $content='Dear '.$res['realname'].',
'; - $content.='Thank you for contacting our editor.
ID: '.$article['accept_sn'].'.

'; - $content.= ' Your manuscript: '.$article['accept_sn'].' has received a new reply; please login https://submission.tmrjournals.com/login to check.
'; - $content.= 'Sincerely,
'.$article['title']; - sendEmail($author['email'],$article['title'],$article['title'],$content,$article['email'],$article['epassword']); + $content = 'Dear ' . $res['realname'] . ',
'; + $content .= 'Thank you for contacting our editor.
ID: ' . $article['accept_sn'] . '.

'; + $content .= ' Your manuscript: ' . $article['accept_sn'] . ' has received a new reply; please login https://submission.tmrjournals.com/login to check.
'; + $content .= 'Sincerely,
' . $article['title']; + sendEmail($author['email'], $article['title'], $article['title'], $content, $article['email'], $article['epassword']); } } - - } diff --git a/application/api/controller/Auto.php b/application/api/controller/Auto.php index f79b278..eef6048 100644 --- a/application/api/controller/Auto.php +++ b/application/api/controller/Auto.php @@ -159,9 +159,18 @@ class Auto extends Controller { public function pppp(){ - $extension_obj = Db::name('exten'); - $file = "D://11.xlsx"; + $journal_abbr_obj = Db::name('journal_abbr'); + $file = "D://bbbb.xlsx"; $res = $this->readExcel($file); + $f = []; + foreach($res as $v){ + $cache['full_name'] = $v['full']; + $cache['little_name'] = $v['aa']; + $f[] = $cache; + // $company_top_obj->insert($cache); + } + $journal_abbr_obj->insertAll($f); + // // dump($res); // $extension_obj->insertAll($res); } @@ -180,15 +189,19 @@ class Auto extends Controller { $highestRow = $sheet->getHighestRow(); $frag = []; $frag1 = []; - for ($i = 2; $i <= $highestRow; $i++) { - $aa = $objPHPExcel->getActiveSheet()->getCell("A" . $i)->getValue(); + for ($i = 0; $i <= $highestRow; $i++) { + $full = $objPHPExcel->getActiveSheet()->getCell("A" . $i)->getValue(); + $aa = $objPHPExcel->getActiveSheet()->getCell("B" . $i)->getValue(); if($aa==''){ continue; } - if(!in_array($aa,$frag1)){ - $frag1[] = $aa; - $frag[] = ['email'=>$aa]; - } + // if(!in_array($aa,$frag1)){ + // $frag1[] = $aa; + // $frag[] = ['email'=>$aa]; + // } + $ch['full'] = $full; + $ch['aa'] = $aa; + $frag[] = $ch; } return $frag; } diff --git a/application/api/controller/Production.php b/application/api/controller/Production.php index 4ac6e5a..c604fda 100644 --- a/application/api/controller/Production.php +++ b/application/api/controller/Production.php @@ -323,7 +323,7 @@ class Production extends Controller if (!$rule->check($data)) { return jsonError($rule->getError()); } - $update['refer_frag'] = trim($data['refer_frag']); + $updata['refer_frag'] = trim($data['refer_frag']); $updata['cs'] = 1; $this->production_article_refer_obj->where('p_refer_id', $data['p_refer_id'])->update($updata); return jsonSuccess([]); @@ -436,6 +436,7 @@ class Production extends Controller $pra['doi'] = $p_info['doi']; $pra['tradition_tag'] = $p_info['tradition_tag']; $pra['tradition'] = $p_info['tradition']; + $pra['mhoo'] = $p_info['mhoo']; $pra['abstract'] = $p_info['abstract']; $pra['pub_date'] = $p_info['pub_date']; $pra['abbr'] = $p_info['abbr']; @@ -623,6 +624,86 @@ class Production extends Controller } + // public function testTypeSetting(){ + // $data['p_article_id'] = 7; + // $p_info = $this->production_article_obj->where('p_article_id', $data['p_article_id'])->find(); + // $article_info = $this->article_obj->where('article_id', $p_info['article_id'])->find(); + // $journal_info = $this->journal_obj->where('journal_id', $p_info['journal_id'])->find(); + // $editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find(); + + // $typesetInfo = []; + // $typesetInfo['info_title'] = $p_info['title']; + // $typesetInfo['info_type'] = $p_info['type']; + // $typesetInfo['doi'] = $p_info['doi']; + // $typesetInfo['topic'] = ''; + // $typesetInfo['mainText'] = $p_info['main']; + + // $au_res = $this->authorFormate($data['p_article_id']); + + // $typesetInfo['author'] = $au_res['author']; + // $typesetInfo['authorAddress'] = $au_res['address']; + // $typesetInfo['authorContribution'] = $p_info['author_contribution']; + + // //查询通讯作者 + // $corr_authors = $this->production_article_author_obj->where('p_article_id', $data['p_article_id'])->where('is_report', 1)->where('state', 0)->select(); + // $corrauthor = ''; + // $corremail = ''; + // foreach ($corr_authors as $v) { + // $corrauthor .= trim($v['first_name']) . ' ' . trim($v['last_name']) . '. '; + // $corremail .= $v['email'] . '. '; + // } + // $typesetInfo['authorCorresponding'] = substr(trim($corrauthor), 0, -1); + // $typesetInfo['authorCorrespondingEmail'] = substr(trim($corremail), 0, -1); + // $typesetInfo['traditon'] = $p_info['tradition']; + // $typesetInfo['journal'] = $journal_info['title']; + // $typesetInfo['jabbr'] = $journal_info['jabbr']; + + // //查询分期 + // $url = 'http://journalapi.tmrjournals.com/public/index.php/master/Journal/getStageDetail'; + // $cs['journal_stage_id'] = $p_info['journal_stage_id']; + // $list = object_to_array(json_decode(myPost($url, $cs))); + // $stage_re = $list['data']['stage']; + + // $typesetInfo['stage'] = $stage_re['stage_year'] . ';' . $stage_re['stage_vol'] . '(' . $stage_re['stage_no'] . '):' . $p_info['npp']; //2022;6(1):17 + // $typesetInfo['little_author'] = $p_info['abbr']; + // $typesetInfo['website'] = $journal_info['website']; + // $typesetInfo['acknowledgment'] = $p_info['acknowledgment']; + // $typesetInfo['received_date'] = date("d F Y", $article_info['ctime']);; + // $typesetInfo['accepted_date'] = date("d F Y", $article_info['rtime']); + // $typesetInfo['online_date'] = $p_info['pub_date']; //这里可能会有问题 + // $typesetInfo['abbreviation'] = $p_info['abbreviation']; + // $typesetInfo['abstractText'] = $p_info['abstract']; + // $typesetInfo['keywords'] = $p_info['keywords']; + // $typesetInfo['userAccount'] = $editor_info['nickname']; + + // //获取文件 + // // $files = $this->article_file_obj + // // ->where('article_id', $article_info['article_id']) + // // ->where('type_name', 'manuscirpt') + // // ->order('ctime desc') + // // ->limit(1) + // // ->select(); + // // if (count($files) == 0) { + // // return jsonError('No Manuscript'); + // // } + // // $typesetInfo['filename'] = "http://api.tmrjournals.com/public/" . $files[0]['file_url']; + + // $rs = $this->production_article_refer_obj->where('p_article_id', $p_info['p_article_id'])->where('state', 0)->select(); + // // $refers = []; + // // foreach ($rs as $v) { + // // $refers[] = $v['refer_frag']; + // // } + + // $typesetInfo['refers'] = json_encode($rs); + + // $url = "http://localhost:8081/typeset/webtest"; + // $res = object_to_array(json_decode(myPost1($url, $typesetInfo))); + + + // dump($res); + // } + + /** * 排版主方法入口 */ @@ -699,14 +780,16 @@ class Production extends Controller $typesetInfo['filename'] = "http://api.tmrjournals.com/public/" . $files[0]['file_url']; $rs = $this->production_article_refer_obj->where('p_article_id', $p_info['p_article_id'])->where('state', 0)->select(); - $refers = []; - foreach ($rs as $v) { - $refers[] = $v['refer_frag']; - } + // $refers = []; + // foreach ($rs as $v) { + // $refers[] = $v['refer_frag']; + // } - $typesetInfo['refers'] = json_encode($refers); + // $typesetInfo['refers'] = json_encode($refers); + $typesetInfo['refers'] = json_encode($rs); $url = "http://ts.tmrjournals.com/api/typeset/webGetDocx"; + // $url = "http://localhost:8081/typeset/webGetDocx"; $res = object_to_array(json_decode(myPost1($url, $typesetInfo))); if (!isset($res['data']['file']) || $res['data']['file'] == '') { @@ -1060,6 +1143,10 @@ class Production extends Controller return jsonSuccess([]); } + public function testtest(){ + $this->doiTofrag(7); + } + public function doiTofrag($p_article_id) { $p_info = $this->production_article_obj->where('p_article_id', $p_article_id)->find(); @@ -1126,7 +1213,7 @@ class Production extends Controller $z = count($list); $m = 0; foreach ($list as $v) { - if ($v['refer_frag'] != '') { + if ($v['refer_frag'] != ''||$v['author']!='') { $m++; } } diff --git a/application/api/controller/Reviewer.php b/application/api/controller/Reviewer.php index c9779fa..b37932c 100644 --- a/application/api/controller/Reviewer.php +++ b/application/api/controller/Reviewer.php @@ -617,6 +617,18 @@ class Reviewer extends Controller return jsonSuccess($re); } + + public function getReviewerOnChina(){ + $res = $this->user_obj + ->field("t_user.email") + ->join("t_user_reviewer_info","t_user_reviewer_info.reviewer_id = t_user.user_id","left") + ->where('t_user_reviewer_info.country','China') + ->whereOr('t_user_reviewer_info.country','中国') + ->select(); + $re['emails']=$res; + return jsonSuccess($re); + } + /** * @title 提交问卷(审稿人) * @description 提交问卷(审稿人) @@ -1559,10 +1571,10 @@ class Reviewer extends Controller ->where('t_reviewer_to_journal.journal_id', 'in', $jous) ->where($gradewhere) ->where('t_reviewer_to_journal.state', 0) - ->where("t_user.account|t_user.realname|t_user.email", "like", '%' . $data['keyword'] . '%') + ->where("t_user.account|t_user.realname|t_user.email|t_user_reviewer_info.field", "like", '%' . $data['keyword'] . '%') ->limit($limit_start, $data['pageSize']) ->select(); - $count = $this->reviewer_to_journal_obj->join('t_user', 't_user.user_id = t_reviewer_to_journal.reviewer_id', 'left')->where('t_reviewer_to_journal.journal_id', 'in', $jous)->where($gradewhere)->where('t_reviewer_to_journal.state', 0)->where("t_user.account|t_user.realname|t_user.email", "like", '%' . $data['keyword'] . '%')->count(); + $count = $this->reviewer_to_journal_obj->join('t_user', 't_user.user_id = t_reviewer_to_journal.reviewer_id', 'left')->join('t_user_reviewer_info', 't_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id', 'LEFT')->where('t_reviewer_to_journal.journal_id', 'in', $jous)->where($gradewhere)->where('t_reviewer_to_journal.state', 0)->where("t_user.account|t_user.realname|t_user.email|t_user_reviewer_info.field", "like", '%' . $data['keyword'] . '%')->count(); } else { $res = $this->reviewer_to_journal_obj ->field('t_reviewer_to_journal.is_yboard,t_user.*,t_reviewer_to_journal.grade,t_user_reviewer_info.*,t_journal.journal_id,t_journal.title journal_title') diff --git a/application/api/controller/Special.php b/application/api/controller/Special.php index 2a30f93..a892a4d 100644 --- a/application/api/controller/Special.php +++ b/application/api/controller/Special.php @@ -28,6 +28,8 @@ class Special extends Controller protected $article_file_obj = ''; protected $article_msg_obj = ''; protected $user_log_obj = ''; + protected $major_obj = ""; + protected $major_to_journal_obj = ''; protected $user_black_obj = ''; protected $user_to_special_obj = ''; protected $chief_to_journal_obj = ''; @@ -54,6 +56,8 @@ class Special extends Controller $this->article_file_obj = Db::name('article_file'); $this->article_msg_obj = Db::name('article_msg'); $this->user_log_obj = Db::name('user_log'); + $this->major_obj = Db::name("major"); + $this->major_to_journal_obj = Db::name('major_to_journal'); $this->user_black_obj = Db::name('user_black'); $this->user_to_special_obj = Db::name('user_to_special'); $this->chief_to_journal_obj = Db::name('chief_to_journal'); @@ -599,7 +603,7 @@ class Special extends Controller if ($res && $res_author && $transr &&$res_add_user && $res_file1 && $res_file2 && $res_file3 && $res_log && $res_msg) { Db::commit(); - $this->ai_scor($data['article_id']); + $this->ai_scor($res); return json(['code' => 0]); } else { Db::rollback(); @@ -647,7 +651,8 @@ class Special extends Controller $url = "http://ts.tmrjournals.com/api/typeset/readPic"; $program['fileRoute'] = "https://submission.tmrjournals.com/public/" . $files[0]['file_url']; $res = object_to_array(json_decode(myPost($url, $program))); - $wp = $res['data']; + $wp = isset($res['data']['pic'])?$res['data']['pic']:2; + $tp = isset($res['data']['table'])?$res['data']['table']:2; $pics = $this->article_file_obj->where('article_id',$article_id)->where('type_name','picturesAndTables')->select(); $np = 0; @@ -662,9 +667,10 @@ class Special extends Controller } $p_num = $wp>$np?$wp:$np; - if($p_num>3){ + $all_num = $p_num+$tp; + if($all_num>3){ $b_fen = 2; - }elseif($p_num>=1){ + }elseif($all_num>=1){ $b_fen = 1; }else{ $b_fen = 0; @@ -683,16 +689,19 @@ class Special extends Controller } //单位 $dw_fen = 0; - $report_author = $this->article_author_obj->where('email',$user_info['email'])->find(); - if($report_author){ - $ca_res = $this->company_top_obj->where('title',$report_author['company'])->find(); - if($ca_res){ - $dw_fen = 1.5; - $fen+=1.5; + $report_author = $this->article_author_obj->where('article_id', $article_id)->where('email', $user_info['email'])->find(); + if ($report_author) { + $ca_res = $this->company_top_obj->where('title', $report_author['company'])->find(); + if ($ca_res) { + if($ca_res['company_id']<=100||($ca_res['company_id']>201&&$ca_res['company_id']<=301)){ + $dw_fen = 1.5; + $fen += 1.5; + }else{ + $dw_fen = 1; + $fen += 1; + } } } - - //领域 $ly_fen = 0; $m = $this->major_obj->where('major_id',$article_info['major_id'])->find(); @@ -703,7 +712,7 @@ class Special extends Controller //基金 $jj_fen = 0; - if(strlen($article_info['fund'])>15){ + if(strlen($article_info['fund'])>10){ $jj_fen = 0.5; $fen += 0.5; } diff --git a/application/api/job/ts.php b/application/api/job/ts.php index 248190c..c821c07 100644 --- a/application/api/job/ts.php +++ b/application/api/job/ts.php @@ -14,7 +14,7 @@ class ts { } public function fire1(Job $job, $data) { - my_doiToFrag1($data); + my_doiToFrag2($data); $job->delete(); } diff --git a/application/common.php b/application/common.php index ff6d1ec..a563b76 100644 --- a/application/common.php +++ b/application/common.php @@ -349,8 +349,10 @@ function my_doiToFrag2($data){ $update['author'] = prgeAuthor($res[0]); $update['title'] = trim($res[1]); $bj = bekjournal($res[2]); - $update['joura'] = formateJournal(trim($bj[0])); - $update['dateno'] = trim($bj[1]); + $joura = formateJournal(trim($bj[0])); + $update['joura'] = $joura; + $update['is_ja'] = $joura==trim($bj[0])?0:1; + $update['dateno'] = str_replace(' ','',str_replace('-','–',trim($bj[1]))); $update['doilink'] = "http://doi.org/".$data['refer_doi']; $update['cs'] = 1; }