This commit is contained in:
wangjinlei
2022-11-10 18:47:29 +08:00
parent 4d176060f4
commit 7bebaf5e68
3 changed files with 82 additions and 8 deletions

View File

@@ -218,6 +218,78 @@ class Board extends Controller {
}
public function mymmm(){
$data = $this->request->post();
$journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
$url = 'http://journalapi.tmrjournals.com/public/index.php/master/Board/getBoardListForSubmit';
$pra = [];
$pra['issn'] = $journal_info['issn'];
$pra['board_group_id'] = -1;
$res = object_to_array(json_decode(myPost($url, $pra)));
$boards = $res['data']['boards'];
$bs = $this->board_to_journal_obj->where('journal_id',$data['journal_id'])->where('state',0)->select();
// $re['num'] = count($boards).'-----------'.count($bs);
// $re['y'] = $boards;
// $re['x'] = $bs;
// $frag = [];
// foreach($bs as $v){
// if(!$this->myarr($v,$boards)){
// $frag[] = $v;
// }
// }
// foreach($frag as $v ){
// $this->board_to_journal_obj->where('btj_id',$v['btj_id'])->update(['state'=>1]);
// }
$frag1 = [];
foreach($boards as $v){
if(!$this->myarr1($v,$bs)){
$frag1[] = $v;
}
}
// foreach($frag1 as $k=>$v){
// $c = $this->user_obj->where('email',$v['email'])->find();
// $frag1[$k]['ch'] = $c;
// if($c){
// $insert['user_id']=$c['user_id'];
// }
// }
// $re['del'] = $frag;
$re['add'] = $frag1;
return jsonSuccess($re);
}
private function myarr($v,$boards){
foreach($boards as $val){
if($v['user_id']==$val['tuser_id']){
return true;
}
}
return false;
}
private function myarr1($v,$bs){
foreach($bs as $val){
if($v['tuser_id']==$val['user_id']){
return true;
}
}
return false;
}
/**
* 获取编委列表
*/
@@ -413,9 +485,9 @@ class Board extends Controller {
}
$user_info = $this->user_obj->where('user_id',$data['user_id'])->find();
$journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
$check = $this->board_to_journal_obj->where('user_id',$data['user_id'])->where('journal_id',$data['journal_id'])->find();
$check = $this->board_to_journal_obj->where('user_id',$data['user_id'])->where('state',0)->find();
if($check){
return jsonError("Add repeatedly");
return jsonError("According to TMR Publishing Group Policy, scientists are not allowed to serve on the editorial board of more than one journal at the same time.");
}
// $url = 'http://www.journal.com/master/Board/addBoard';