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

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