This commit is contained in:
王金磊
2023-04-07 16:46:17 +08:00
parent e4be850ba1
commit fed98c4397
6 changed files with 264 additions and 212 deletions

View File

@@ -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 .= '<a href="https://www.tmrjournals.com/draw_up.html?issn=' . $journal_info['issn'] . '">Subscribe to this journal</a><br>';
$tt .= 'Email: ' . $journal_info['email'] . '<br>';
$tt .= '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'] . ',<br/><br/>';
@@ -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 {

View File

@@ -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 '<pre>';
var_dump($list);
echo '</pre>';
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 = '/<a .*?href="(.*?)".*?>/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("&nbsp;",' ',$val);
}else{
$chc[] = str_replace("&nbsp;",' ',$val);
}
}
$cache['name'] = str_replace("&nbsp;",' ',$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!!!!';
}
/**
* 审查文章审稿人状态,返回结果
*/

View File

@@ -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);
}
}
?>

View File

@@ -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']);

View File

@@ -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
*/

View File

@@ -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<br/><br/>";
$content .= "We sincerely invite you to subscribe to our journal <b>Traditional Medicine Research</b> (TMR) (ISSN 2413-3973).<br/>";
$content .= "If you are interested in our journalit is easy to subscribe to journals and topics on our official website. Please click here:<br/>";
$content .= "<a href='https://www.tmrjournals.com/draw_up.html?issn=2413-3973'>https://www.tmrjournals.com/draw_up.html?issn=2413-3973</a><br/><br/>";
$content .= "Updates to the topics you have subscribed to will be sent to your mailbox.<br/><br/>";
$content .= "Thank you for your attention to our invitation. If you have any questions, do not hesitate to contact us.<br/><br/>";
$content .= "<span style='font-size:6px;line-height:30px;'>TMR is a peer-reviewed open access journal managed by TMR Publishing Group. TMR is dedicated to protecting and developing all types of traditional medicines, including traditional Chinese medicine, Persian medicine, Ayurveda, Siddha, minority medicine, etc., using the latest achievements in modern science. TMR emphasizes the historical origin and developmental pipeline of the research objective and encourages authors to analyze the theoretical significance underlying a study and the application of traditional medicine in clinical practice.</span><br/><br/>";
$content .= "Best wishes,<br/>";
$content .= "TMR Publishing Group";
$maidata['email'] = $v['email'];
$maidata['title'] = "Traditional Medicine Research";
$maidata['content'] = $content;
$maidata['tmail'] = "tmrweb@tmrjournals.com";
$maidata['tpassword'] = "Wu999999tmrwe";
Queue::push('app\api\job\mail@fire', $maidata, "tmail");
public function getAuthorUserList(){
$data = $this->request->post();
$rule = new Validate([
'journal_id' => 'require',
'pageIndex' => 'require',
'pageSize' => 'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
$where['t_user_author.journal_title'] = $journal_info['title'];
$where['t_user_author.state'] = 0;
if(isset($data['major'])&&$data['major']!=0){
$where['t_user_reviewer_info.major'] = $data['major'];
}
if(isset($data['keywords'])&&trim($data['keywords'])!=''){
$where['t_user.account|t_user.email|t_user.realname'] = ['like',"%".trim($data['keywords'])."%"];
}
$list = $this->user_author_obj
->join([['t_user','t_user.user_id = t_user_author.user_id','left'],['t_user_reviewer_info','t_user_reviewer_info.reviewer_id=t_user.user_id','left']])
->where($where)
->page($data['pageIndex'],$data['pageSize'])
->group("t_user_author.user_id")
->select();
$count = $this->user_author_obj->join([['t_user','t_user.user_id = t_user_author.user_id','left'],['t_user_reviewer_info','t_user_reviewer_info.reviewer_id=t_user.user_id','left']])->where($where)->group("t_user_author.user_id")->count();
foreach($list as $k=>$v){
$ca = $this->user_author_obj->where('user_id',$v['user_id'])->where('state',0)->select();
$carr = [];
foreach($ca as $val){
$a = $this->journal_obj->where('title',$val['journal_title'])->find();
$c['journal_abbr'] = $a['abbr'];
$c['doi'] = $val['w_article_doi'];
$c['link'] = "https://www.tmrjournals.com/article.html?J_num=".$a['web_journal_id']."&a_id=".$val['w_article_id'];
$carr[] = $c;
}
$list[$k]['art_detail'] = $carr;
$list[$k]['major_str'] = getMajorStr($v['major']);
}
$re['list'] = $list;
$re['count'] = $count;
return jsonSuccess($re);
}
/**
@@ -692,7 +714,7 @@ class User extends Base
$aa['field'] = $objPHPExcel->getActiveSheet()->getCell("D" . $i)->getValue();
$aa['intro'] = $objPHPExcel->getActiveSheet()->getCell("E" . $i)->getValue();
$aa['company'] = $objPHPExcel->getActiveSheet()->getCell("F" . $i)->getValue();
$aa['title'] = $objPHPExcel->getActiveSheet()->getCell("G" . $i)->getValue();
$aa['title'] = trim($objPHPExcel->getActiveSheet()->getCell("G" . $i)->getValue());
$aa['remark'] = $objPHPExcel->getActiveSheet()->getCell("H" . $i)->getValue();
// $aa['username'] = $objPHPExcel->getActiveSheet()->getCell("A" . $i)->getValue();
// $aa['has'] = '未出证';
@@ -920,31 +942,41 @@ class User extends Base
* 添加作者用户
*/
public function addUserForAuthor(){
die("service stop!!");
$num = $this->request->post('num');
$num =1;
// $num =1;
$cs['num'] = $num;
$url = 'http://journalapi.tmrjournals.com/public/index.php/master/Article/getArticleReportAuthors';
$list = object_to_array(json_decode(myPost($url, $cs)));
dump($list);
// foreach($list as $v){
// foreach($v['author'] as $val){
// $check_user = $this->user_obj->where('email',$val['email'])->where('state',0)->find();
// if(!$check_user){
// $ui['account'] = $val['email'];
// $ui['password'] = md5("123456qwe");
// $ui['email'] = $val['email'];
// $ui['realname'] = $val['author_name'];
// $ui['ctime'] = time();
// $uid = $this->user_obj->insertGetId($ui);
// $uir['reviewer_id'] = $uid;
// $uir['country'] = $val['author_country'];
// $this->user_reviewer_info_obj->insert($uir);
// $check_user = $this->user_obj->where('user_id',$uid)->find();
// }
// }
// }
$count = 0;
foreach($list['data']['list'] as $v){
if(!isset($v['author'])||!is_array($v['author'])){
echo 'ok';
continue;
}
foreach($v['author'] as $val){
$check_user = $this->user_obj->where('email',$val['email'])->where('state',0)->find();
if(!$check_user){
$ui['account'] = $val['email'];
$ui['password'] = md5("123456qwe");
$ui['email'] = $val['email'];
$ui['realname'] = $val['author_name'];
$ui['ctime'] = time();
$uid = $this->user_obj->insertGetId($ui);
$uir['reviewer_id'] = $uid;
$uir['country'] = trim($val['author_country']);
$this->user_reviewer_info_obj->insert($uir);
$check_user = $this->user_obj->where('user_id',$uid)->find();
}
$iau['user_id'] = $check_user['user_id'];
$iau['w_article_id'] = $v['article_id'];
$iau['w_article_doi'] = $v['doi'];
$iau['journal_title'] = $v['journal_title'];
$this->user_author_obj->insert($iau);
}
$count++;
}
return jsonSuccess(['count'=>$count]);
}
/**
@@ -1067,6 +1099,7 @@ class User extends Base
*/
public function applyReviewerForReviewer()
{
die("service stop!!");
$data = $this->request->post();
$user_info = $this->user_obj->where('account', trim($data['username']))->find();
$journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find();
@@ -1842,11 +1875,85 @@ class User extends Base
return jsonSuccess($rtjs);
}
/**
* 获取审稿人申请列表
*/
public function getApplyReviewerList(){
$data = $this->request->post();
$rule = new Validate([
'journal_id'=>'require',
'editor_id'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$where['t_apply_reviewer.state'] = 0;
if($data['journal_id']==0){
$journalIds = $this->journal_obj->where('editor_id',$data['editor_id'])->column("journal_id");
$where['t_apply_reviewer.journal_id'] = ['in',$journalIds];
}else{
$where['t_apply_reviewer.journal_id'] = $data['journal_id'];
}
$list = $this->apply_reviewer_obj
->field("t_user.*,t_journal.title journal_title,t_apply_reviewer.ap_reviewer_id,t_apply_reviewer.ctime apply_time")
->join("t_user","t_user.user_id = t_apply_reviewer.user_id",'left')
->join("t_journal","t_journal.journal_id=t_apply_reviewer.journal_id","left")
->where($where)
->select();
$re['list'] = $list;
return jsonSuccess($re);
}
/**
* 同意审稿人身份申请
*/
public function agreeReviewerApply(){
$data = $this->request->post();
$rule = new Validate([
'ap_reviewer_id'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$ap_reviewer_info = $this->apply_reviewer_obj->where('ap_reviewer_id',$data['ap_reviewer_id'])->find();
$journal_info = $this->journal_obj->where('journal_id',$ap_reviewer_info['journal_id'])->find();
$user_info = $this->user_obj->where('user_id',$ap_reviewer_info['user_id'])->find();
$check = $this->reviewer_to_journal_obj->where('reviewer_id',$ap_reviewer_info['user_id'])->where('journal_id',$journal_info['journal_id'])->where('state',0)->find();
if($check){
return jsonSuccess([]);
}
$insert['reviewer_id'] = $ap_reviewer_info['user_id'];
$insert['journal_id'] = $journal_info['journal_id'];
$insert['account'] = $user_info['account'];
$insert['journal_title'] = $journal_info['title'];
$insert['ctime'] = time();
$this->reviewer_to_journal_obj->insert($insert);
$this->apply_reviewer_obj->where('ap_reviewer_id',$data['ap_reviewer_id'])->update(['state'=>1]);
return jsonSuccess([]);
}
/**
* 拒绝审稿人申请
*/
public function refuseReviewerApply(){
$data = $this->request->post();
$rule = new Validate([
'ap_reviewer_id'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$this->apply_reviewer_obj->where('ap_reviewer_id',$data['ap_reviewer_id'])->update(['state'=>1]);
return jsonSuccess([]);
}
/**
* 获取审核员申请列表
*/
public function getReviewerApplyList()
{
die("service stop!!");
$data = $this->request->post();
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
$where['state'] = 0;
@@ -1867,6 +1974,7 @@ class User extends Base
*/
public function getApplyDetail()
{
die("service stop!!");
$reviewerId = $this->request->post('reviewerApplyId');
$where['t_user_reviewer_apply.reviewer_apply_id'] = $reviewerId;
$res = $this->user_reviewer_obj
@@ -2036,6 +2144,7 @@ class User extends Base
*/
public function reviewerAdopt()
{
die("service stop!!");
$reviewerId = $this->request->post('reviewerApplyId');
$where['reviewer_apply_id'] = $reviewerId;
$apply_info = $this->user_reviewer_obj->where($where)->find();
@@ -2252,6 +2361,7 @@ class User extends Base
*/
public function reviewerRejec()
{
die("service stop!!");
$reviewerId = $this->request->post('reviewerApplyId');
$where['reviewer_apply_id'] = $reviewerId;
$this->user_reviewer_obj->where($where)->update(['state' => 2]);