1
This commit is contained in:
@@ -4,6 +4,8 @@ namespace app\api\controller;
|
||||
|
||||
use think\Controller;
|
||||
use think\Db;
|
||||
use think\Validate;
|
||||
use app\api\controller\User as usercontroller;
|
||||
use think\Queue;
|
||||
|
||||
/**
|
||||
@@ -26,6 +28,7 @@ class Journal extends Controller {
|
||||
protected $user_reviewer_info_obj = '';
|
||||
protected $user_reviewer_obj = '';
|
||||
protected $user_msg_obj = '';
|
||||
protected $user_to_special_obj = '';
|
||||
|
||||
public function __construct(\think\Request $request = null) {
|
||||
parent::__construct($request);
|
||||
@@ -43,6 +46,7 @@ class Journal extends Controller {
|
||||
$this->article_msg_obj = Db::name('article_msg');
|
||||
$this->article_author_obj = Db::name('article_author');
|
||||
$this->country_obj = Db::name('country');
|
||||
$this->user_to_special_obj = Db::name('user_to_special');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,4 +96,37 @@ class Journal extends Controller {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取可申请审稿人的期刊
|
||||
*/
|
||||
public function getJournalsForReviewerInEditor(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
'account' => 'require',
|
||||
'reviewer_id' => 'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
|
||||
$editor_info = $this->user_obj->where('account',$data['account'])->find();
|
||||
$journalIds = [];
|
||||
if($editor_info['type']==2){//责任编辑
|
||||
$journalIds = $this->journal_obj->where('eidtor_id',$editor_info['user_id'])->column('journal_id');
|
||||
}else{//客座编辑
|
||||
$guests = $this->user_to_special_obj->where('user_id',$data['reviewer_id'])->where('uts_state',0)->select();
|
||||
$usercontroller = new usercontroller();
|
||||
foreach($guests as $v){
|
||||
$c_res = $usercontroller->getSpecialDetailById($v['special_id']);
|
||||
$journalIds[] = $this->journal_obj->where('issn',$c_res['journal_issn'])->value('journal_id');
|
||||
}
|
||||
}
|
||||
$njournalIds = $this->reviewer_to_journal_obj->where('reviewer_id',$data['user_id'])->where('state',0)->column('journal_id');
|
||||
$list = $this->journal_obj->where('journal_id',"not in",$njournalIds)->where('journal_id',"in",$journalIds)->where('state',0)->select();
|
||||
|
||||
$re['journals'] = $list;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user