This commit is contained in:
wangjinlei
2022-04-15 15:23:57 +08:00
parent 76779b3672
commit 91600d2ed3
3 changed files with 74 additions and 5 deletions

View File

@@ -102,17 +102,17 @@ class Journal extends Controller {
public function getJournalsForReviewerInEditor(){
$data = $this->request->post();
$rule = new Validate([
'account' => 'require',
'editor_id' => 'require',
'reviewer_id' => 'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$editor_info = $this->user_obj->where('account',$data['account'])->find();
$editor_info = $this->user_obj->where('user_id',$data['editor_id'])->find();
$journalIds = [];
if($editor_info['type']==2){//责任编辑
$journalIds = $this->journal_obj->where('eidtor_id',$editor_info['user_id'])->column('journal_id');
$journalIds = $this->journal_obj->where('editor_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();
@@ -121,7 +121,7 @@ class Journal extends Controller {
$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');
$njournalIds = $this->reviewer_to_journal_obj->where('reviewer_id',$data['reviewer_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;