20201112
This commit is contained in:
@@ -120,6 +120,51 @@ class User extends Controller {
|
||||
Queue::push( 'app\api\job\mail@fire' , $maidata , "tmail" );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 申请期刊审稿人对于审稿人
|
||||
* @description 申请期刊审稿人对于审稿人
|
||||
* @author wangjinlei
|
||||
* @url /api/User/applyReviewerForReviewer
|
||||
* @method POST
|
||||
*
|
||||
* @param name:username type:string require:1 desc:用户名
|
||||
* @param name:journal_id type:int require:1 desc:期刊id
|
||||
*
|
||||
*/
|
||||
public function applyReviewerForReviewer(){
|
||||
$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();
|
||||
$editor_info = $this->user_obj->where('user_id',$journal_info['editor_id'])->find();
|
||||
$reviewer_info_info = $this->user_reviewer_info_obj->where('reviewer_id',$user_info['user_id'])->where('state',0)->find();
|
||||
$check = $this->reviewer_to_journal_obj->where("reviewer_id",$user_info['user_id'])->where('journal_id',$data['journal_id'])->where('state',0)->find();
|
||||
$check1 = $this->user_reviewer_obj->where('name',trim($data['username']))->where('journal_id',$data['journal_id'])->find();
|
||||
if($check||$check1){
|
||||
return jsonError("You are already in the reviewer list of this journal");
|
||||
}
|
||||
$insert_data['journal_id'] = $data['journal_id'];
|
||||
$insert_data['name'] = trim($data['username']);
|
||||
$insert_data['introduction'] = $reviewer_info_info['introduction'];
|
||||
$insert_data['email'] = $user_info['email'];
|
||||
$insert_data['company'] = $reviewer_info_info['company'];
|
||||
$insert_data['country'] = $reviewer_info_info['country'];
|
||||
$insert_data['major'] = $reviewer_info_info['major'];
|
||||
$insert_data['technical'] = $reviewer_info_info['technical'];
|
||||
$insert_data['field'] = $reviewer_info_info['field'];
|
||||
$insert_data['gender'] = $reviewer_info_info['gender'];
|
||||
$insert_data['qualifications'] = $reviewer_info_info['qualifications'];
|
||||
$insert_data['ctime'] = time();
|
||||
$res = $this->user_reviewer_obj->insertGetId($insert_data);
|
||||
//发送email-》编辑
|
||||
$tt = 'Dear editor,<br>';
|
||||
$tt .= 'Please check the new reviewer application.';
|
||||
sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
|
||||
//发送消息信息--编辑
|
||||
add_usermsg($journal_info['editor_id'], '新增审稿人申请,申请人(' . $data['username'] . ')', '/reviewerApplyDetail?id=' . $res);
|
||||
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 审稿系统登录功能
|
||||
@@ -525,11 +570,18 @@ class User extends Controller {
|
||||
* 通过审核人
|
||||
*/
|
||||
public function reviewerAdopt() {
|
||||
$reviewerId = $this->request->post('reviewerId');
|
||||
$where['reviewer_id'] = $reviewerId;
|
||||
$reviewerId = $this->request->post('reviewerApplyId');
|
||||
$where['reviewer_apply_id'] = $reviewerId;
|
||||
$apply_info = $this->user_reviewer_obj->where($where)->find();
|
||||
$journal_info = $this->journal_obj->where('journal_id', $apply_info['journal_id'])->find();
|
||||
$has_res = $this->user_obj->where('account', $apply_info['name'])->find();
|
||||
//检测是否已经存在此审稿人
|
||||
if($has_res){
|
||||
$check = $this->reviewer_to_journal_obj->where('reviewer_id',$has_res['user_id'])->where('journal_id',$journal_info['journal_id'])->where('state',0)->find();
|
||||
if($check){
|
||||
return jsonError("has reviewer!");
|
||||
}
|
||||
}
|
||||
Db::startTrans();
|
||||
if ($has_res == null) {
|
||||
$insert_data['account'] = $apply_info['name'];
|
||||
@@ -635,13 +687,54 @@ class User extends Controller {
|
||||
return json(['code' => 0]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 审查用户是否是审稿人
|
||||
* @description 审查用户是否是审稿人
|
||||
* @author wangjinlei
|
||||
* @url /api/User/checkUserIsReviewer
|
||||
* @method POST
|
||||
*
|
||||
* @param name:username type:String require:1 desc:account
|
||||
*
|
||||
* @return is:0否1是
|
||||
*
|
||||
*/
|
||||
public function checkUserIsReviewer(){
|
||||
$data = $this->request->post();
|
||||
$user_info = $this->user_obj->where('account',$data['username'])->find();
|
||||
$check = $this->reviewer_to_journal_obj->where('reviewer_id',$user_info['user_id'])->where('state',0)->find();
|
||||
|
||||
$re['is'] = $check==null?0:1;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 审查用户是否存在通过用户名或邮箱
|
||||
* @description 审查用户是否存在通过用户名或邮箱
|
||||
* @author wangjinlei
|
||||
* @url /api/User/checkUserByAccountOrEmail
|
||||
* @method POST
|
||||
*
|
||||
* @param name:username type:String require:1 desc:account/email
|
||||
*
|
||||
* @return has:0无1有
|
||||
*
|
||||
*/
|
||||
public function checkUserByAccountOrEmail(){
|
||||
$data = $this->request->post();
|
||||
$check_info = $this->user_obj->where("account|email",$data['username'])->where("state",0)->find();
|
||||
|
||||
$re['has'] = $check_info==null?0:1;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* 拒绝审核人
|
||||
*/
|
||||
public function reviewerRejec() {
|
||||
$reviewerId = $this->request->post('reviewerId');
|
||||
$where['reviewer_id'] = $reviewerId;
|
||||
$reviewerId = $this->request->post('reviewerApplyId');
|
||||
$where['reviewer_apply_id'] = $reviewerId;
|
||||
$this->user_reviewer_obj->where($where)->update(['state' => 2]);
|
||||
|
||||
//拒绝审稿人email-》审稿人
|
||||
@@ -650,7 +743,14 @@ class User extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取专业列表
|
||||
* @title 获取专业列表(未来会废弃)
|
||||
* @description 获取专业列表(未来会废弃)
|
||||
* @author wangjinlei
|
||||
* @url /api/User/getMajorList
|
||||
* @method POST
|
||||
*
|
||||
*
|
||||
* @return data:领域列表#
|
||||
*/
|
||||
public function getMajorList() {
|
||||
$res = $this->reviewer_major_obj->select();
|
||||
|
||||
Reference in New Issue
Block a user