diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php
index 61ed094..9263866 100644
--- a/application/api/controller/Article.php
+++ b/application/api/controller/Article.php
@@ -328,7 +328,7 @@ class Article extends Base
// $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']);
//查询文章作者信息
$author_res = $this->article_author_obj->where('article_id', $data['articleId'])->where('state', 0)->select();
@@ -1152,7 +1152,7 @@ class Article extends Base
$tt .= 'Subscribe to this journal
';
$tt .= 'Email: ' . $journal_info['email'] . '
';
$tt .= 'Website: ' . $journal_info['website'];
- if ($data['state'] != 5 || $journal_info['journal_id'] != 9) {
+ // if ($data['state'] != 5) {//不接收的邮件发送
$sendUser['content'] = $tt;
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
if ($data['state'] == 4) {
@@ -1160,7 +1160,10 @@ class Article extends Base
} else {
sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
}
- }
+ // }else{//接收文章时应该发送到所有人上,包括所有作者和上传用户
+
+
+ // }
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) {
@@ -2051,7 +2054,11 @@ class Article extends Base
$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);
+ $uid = $this->user_obj->insertGetId($inser_data);
+ $iuri['reviewer_id'] = $uid;
+ $iuri['country'] = $v['country'];
+ $iuri['technical'] = $v['author_title'];
+ $this->user_reviewer_info_obj->insert($iuri);
//发送提示邮件给通讯作者
$report_tt = "Dear " . $inser_data['realname'] . ',
';
@@ -2675,15 +2682,16 @@ class Article extends Base
$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')
+ ->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_user_reviewer_info.major')
->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')
+ // ->join('t_reviewer_major', 't_reviewer_major.major_id = t_user_reviewer_info.major', 'LEFT')
->where($where)->limit($limit_start, $data['pageSize'])->select();
-
-
-
$count = $this->article_reviewer_obj->where($where)->count();
+
+ foreach($res as $k => $v){
+ $res[$k]['major_str'] = $this->getMajorStr($v['major']);
+ }
if ($res) {
return json(['code' => 0, 'data' => $res, 'totle' => $count]);
} else {
diff --git a/application/api/controller/Auto.php b/application/api/controller/Auto.php
index b0b79d6..c7eee27 100644
--- a/application/api/controller/Auto.php
+++ b/application/api/controller/Auto.php
@@ -45,113 +45,6 @@ class Auto extends Controller
$this->user_cv_obj = Db::name('user_cv');
}
- public function phpinfo()
- {
- phpinfo();
- }
-
- public function testEmail()
- {
- $journal_info = $this->journal_obj->where('journal_id', 4)->find();
- $maidata['email'] = "751475802@qq.com";
- $maidata['title'] = "test email";
- $maidata['content'] = "test content";
- $maidata['tmail'] = $journal_info['email'];
- $maidata['tpassword'] = $journal_info['epassword'];
- // Queue::push('app\api\job\mail@fire', $maidata, "tmail");
- sendEmail($maidata['email'], $journal_info['title'], $journal_info['title'], $maidata['title'], $journal_info['email'], $journal_info['epassword']);
- }
-
- public function resetReviewerPassword()
- {
- $list = $this->user_obj
- ->field("t_user.*")
- ->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_user.user_id", "left")
- ->where("t_user_reviewer_info.reviewer_info_id", ">", 0)
- ->where("t_user.password", "e9f5c5240c0bb39488e6dbfbdb1517e0")
- ->where("t_user.state", 0)
- ->select();
- echo '
'; - var_dump($list); - echo ''; - die; - } - - - public function pctest1() - { - $url1 = "https://sky.yangtzeu.edu.cn/szdw/zzjs.htm"; - $url2 = "https://sky.yangtzeu.edu.cn/szdw/dsyl.htm"; - $result1 = self::pcread($url1); - $result2 = self::pcread($url2); - $preg = '//is'; - preg_match_all($preg, $result1, $array1); - preg_match_all($preg, $result2, $array2); - $arr = array_merge($array1[1],$array2[1]); - $array = []; - foreach ($arr as $v) { - if (stripos($v, '1009')) { - if(!stripos($v,'yangtzeu.edu')){ - $array[] = "https://sky.yangtzeu.edu.cn/".substr($v,3); - }else{ - $array[] = $v; - } - } - } - $frag = []; - - foreach($array as $v){ - $res = self::pcread($v); - preg_match('/一、基本信息<\/span>.*?<\/div>/is',$res,$r); - if(!isset($r[0])){ - continue; - } - $str = strip_tags($r[0]); - $res_arr = explode(PHP_EOL,$str); - $cache = []; - $chc = []; - foreach($res_arr as $val){ - if(stripos($val,'mail')){ - $cache['email'] = str_replace(" ",' ',$val); - }else{ - $chc[] = str_replace(" ",' ',$val); - } - - } - $cache['name'] = str_replace(" ",' ',$res_arr[1]); - - $cache['all'] = $chc; - - $frag[] = $cache; - } - dump($frag); - - // $res = self::pcread($array[1]); - - // preg_match('/一、基本信息<\/span>.*?<\/div>/is',$res,$r); - // $str = strip_tags($r[0]); - // $res_arr = explode(PHP_EOL,$str); - - - - // dump(explode(PHP_EOL,$str)); - } - - - - public function pcread($url) - { - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_HEADER, 0); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //禁止调用时就输出获取到的数据 - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); - $result = curl_exec($ch); - curl_close($ch); - return $result; - } /** * 推送邮件给审稿人提醒审稿人 @@ -277,35 +170,6 @@ class Auto extends Controller // } - public function qqqq() - { - $extension_obj = Db::name('exten'); - $data = $this->request->post(); - $num = $data['num']; - - $limit_start = ($num - 1) * 1000; - $list = $extension_obj->limit($limit_start, 1000)->select(); - $re['list'] = $list; - return jsonSuccess($re); - } - - - public function pppp() - { - $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); - } private function readExcel($path) { @@ -460,12 +324,6 @@ class Auto extends Controller } } - public function testrev() - { - $a = $this->article_obj->where('article_id', 261)->find(); - // $this->checkrev($a); - } - /** * 处理过期审稿 */ @@ -483,21 +341,6 @@ class Auto extends Controller } } - public function testmail() - { - $maidata['email'] = '751475802@qq.com'; - $maidata['title'] = 'testdsdsasaddsasdaadsasd' . date('Ymd His', time()); - $maidata['content'] = 'dsadsaas'; - $maidata['tmail'] = 'tmrcancer@tmrjournals.com'; - $maidata['tpassword'] = 'Wu999999tmrcance'; - Queue::push('app\api\job\mail@fire', $maidata, "tmail"); - } - - public function mytest() - { - echo 'okokokook!!!!'; - } - /** * 审查文章审稿人状态,返回结果 */ diff --git a/application/api/controller/Base.php b/application/api/controller/Base.php index 3594527..bb66d6c 100644 --- a/application/api/controller/Base.php +++ b/application/api/controller/Base.php @@ -62,6 +62,7 @@ class Base extends Controller protected $production_article_refer_obj = ''; protected $production_article_author_to_organ_obj = ''; protected $production_article_frag_obj = ''; + protected $apply_reviewer_obj = ''; public function __construct(\think\Request $request = null) { @@ -87,6 +88,7 @@ class Base extends Controller $this->user_cert_obj = Db::name('user_cert'); $this->apply_board_obj = Db::name('apply_board'); $this->apply_yboard_obj = Db::name('apply_yboard'); + $this->user_author_obj = Db::name('user_author'); $this->user_score_log_obj = Db::name('user_score_log'); $this->user_index_log_obj = Db::name('user_index_log'); $this->article_reviewer_obj = Db::name('article_reviewer'); @@ -121,6 +123,7 @@ class Base extends Controller $this->production_article_refer_obj = Db::name('production_article_refer'); $this->production_article_author_to_organ_obj = Db::name('production_article_author_to_organ'); $this->production_article_frag_obj = Db::name('production_article_frag'); + $this->apply_reviewer_obj = Db::name("apply_reviewer"); } @@ -249,5 +252,6 @@ class Base extends Controller return substr($frag, 0, -1); } + } ?> \ No newline at end of file diff --git a/application/api/controller/Production.php b/application/api/controller/Production.php index d9896f0..d789f0e 100644 --- a/application/api/controller/Production.php +++ b/application/api/controller/Production.php @@ -55,7 +55,7 @@ class Production extends Base $program['fileRoute'] = "https://submission.tmrjournals.com/public/" . $files[0]['file_url']; $res = object_to_array(json_decode(myPost($url, $program))); - return jsonSuccess($program); + // return jsonSuccess($program); $file_runs = $res['data']; //整理信息 @@ -345,6 +345,7 @@ class Production extends Base $article_info = $this->article_obj->where('article_id', $p_info['article_id'])->find(); $journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find(); $authors = $this->production_article_author_obj->where('p_article_id', $data['p_article_id'])->where('state', 0)->select(); + $report_authors = []; foreach ($authors as $k => $v) { $cache = $this->production_article_author_to_organ_obj ->field('t_production_article_organ.organ_name') @@ -353,6 +354,11 @@ class Production extends Base ->where('t_production_article_author_to_organ.state', 0) ->select(); $authors[$k]['organs'] = $cache; + if($v['is_report']==1){ + $c_user = $this->user_obj->where('email',$v['email'])->find(); + $cac['user_id'] = $c_user['user_id']; + $report_authors[] = $cac; + } } $organs = $this->production_article_organ_obj->where('p_article_id', $data['p_article_id'])->where('state', 0)->select(); //check信息是否完整 @@ -400,6 +406,13 @@ class Production extends Base $res = object_to_array(json_decode(myPost($url, $pra))); if ($res['code'] == 0) { $this->production_article_obj->where('p_article_id', $data['p_article_id'])->update(['state' => 2]); + foreach($report_authors as $v){ + $iua['user_id'] = $v['user_id']; + $iua['w_article_id'] = $res['date']['article_id']; + $iua['w_article_doi'] = '10.53388/'.$p_info['doi']; + $iua['journal_title'] = $journal_info['title']; + $this->user_author_obj->insert($iua); + } return jsonSuccess([]); } else { return jsonError('system error:' . $res['msg']); diff --git a/application/api/controller/Ucenter.php b/application/api/controller/Ucenter.php index 1caafd5..7f4f317 100644 --- a/application/api/controller/Ucenter.php +++ b/application/api/controller/Ucenter.php @@ -81,6 +81,22 @@ class Ucenter extends Base{ return jsonSuccess($userInfo); } + /** + * 检测是否可申请审稿人 + */ + public function checkApplyReviewer(){ + $data = $this->request->post(); + $rule = new Validate([ + 'user_id'=>'require' + ]); + if(!$rule->check($data)){ + return jsonError($rule->getError()); + } + $user_info = $this->user_obj->where('user_id',$data['user_id'])->find(); + $reviewer_info = $this->user_reviewer_info_obj->where('reviewer_id',$data['user_id'])->find(); + + } + public function getCanApplyJournal(){ $data = $this->request->post(); $rule = new Validate([ @@ -144,6 +160,40 @@ class Ucenter extends Base{ return $frag; } + /** + * 审查用户对身份的申请条件是否通过 + */ + public function checkApply(){ + $data = $this->request->post(); + $rule = new Validate([ + 'user_id'=>'require', + 'type'=>'require' + ]); + if(!$rule->check($data)){ + return jsonError($rule->getError()); + } + $user_info=$this->user_obj->join("t_user_reviewer_info","t_user_reviewer_info.reviewer_id = t_user.user_id",'left')->where('t_user.user_id',$data['user_id'])->find(); + $cv = $this->user_cv_obj->where('user_id',$data['user_id'])->where('state',0)->find(); + if($user_info['realname']==''||$user_info['company']==''||$user_info['technical']==''||$user_info['major']==0||$user_info['field']==''||!$cv){ + $str = ''; + switch($data['type']){ + case 1: + $str = "Please kindly note that before proceeding to the reviewer application, it is essential to complete your profile with the following details: your full name, affiliation, academic title, academic website, research interests, and curriculum vitae. Thank you for your interest in making a valuable contribution to our journal as a reviewer."; + break; + case 2: + $str = "Please kindly note that before proceeding to the young scientist application, it is essential to complete your profile with the following details: your full name, affiliation, academic title, academic website, research interests, and curriculum vitae. Thank you for your interest in making a valuable contribution to our journal as a young scientist."; + break; + case 3: + $str = "Please kindly note that before proceeding to the editorial board member application, it is essential to complete your profile with the following details: your full name, affiliation, academic title, academic website, research interests, and curriculum vitae. Thank you for your interest in making a valuable contribution to our journal as an editorial board member."; + break; + default : + $str = "Please kindly note that before proceeding to the reviewer application, it is essential to complete your profile with the following details: your full name, affiliation, academic title, academic website, research interests, and curriculum vitae. Thank you for your interest in making a valuable contribution to our journal as a reviewer."; + } + return jsonError($str); + } + return jsonSuccess([]); + } + public function applyBoard(){ $data = $this->request->post(); $rule = new Validate([ @@ -164,6 +214,30 @@ class Ucenter extends Base{ return jsonSuccess([]); } + /** + * 申请成为审稿人 + */ + public function applyReviewer(){ + $data = $this->request->post(); + $rule = new Validate([ + 'user_id'=>'require', + 'journal_id'=>'require' + ]); + if(!$rule->check($data)){ + return jsonError($rule->getError()); + } + $check1 = $this->apply_reviewer_obj->where('user_id',$data['user_id'])->where('journal_id',$data['journal_id'])->find(); + $check2 = $this->reviewer_to_journal_obj->where('reviewer_id',$data['user_id'])->where('journal_id',$data['journal_id'])->find(); + if($check1||$check2){ + return jsonError("Your reviewer application is already under review or has been accepted. Please do not submit a duplicate application."); + } + $insert['user_id'] = $data['user_id']; + $insert['journal_id'] = $data['journal_id']; + $insert['ctime'] = time(); + $this->apply_reviewer_obj->insert($insert); + return jsonSuccess([]); + } + /** * 增加用户cv */ diff --git a/application/api/controller/User.php b/application/api/controller/User.php index 32a3f22..a724092 100644 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -24,7 +24,7 @@ class User extends Base } public function pstest(){ - echo md5('tmrmhm!'); + echo md5('mtrsuper999'); } /** @@ -397,30 +397,52 @@ class User extends Base } /** - * 为所有用户发送邮件 + * 获取作者库列表 */ - public function pushEmail() - { - die; - $list = $this->user_obj->where('state', 0)->select(); - //发送邮件通知审稿人 - foreach ($list as $v) { - $content = "Dear Researcher,