diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index 830f5ea..10ce108 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -2042,7 +2042,6 @@ class Article extends Controller { * 存储article文件历史信息 */ private function save_article_file($article_id, $user_id, $username, $url, $type_name) { - //首先确定数据库里面是否存在此数据 $res = $this->article_file_obj->where(['file_url' => $url])->find(); if ($res) {//编辑的时候不能重复存储 diff --git a/application/api/controller/Board.php b/application/api/controller/Board.php index 157938f..58b8b72 100644 --- a/application/api/controller/Board.php +++ b/application/api/controller/Board.php @@ -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'; diff --git a/application/api/controller/Special.php b/application/api/controller/Special.php index e290c55..56a854e 100644 --- a/application/api/controller/Special.php +++ b/application/api/controller/Special.php @@ -522,7 +522,7 @@ class Special extends Controller //增加articlefile表的信息 $res_file1 = self::save_article_file($res, $user_res['user_id'], $user_res['account'], $data['coverLetter'], 'coverLetter'); $res_file2 = self::save_article_file($res, $user_res['user_id'], $user_res['account'], $data['picturesAndTables'], 'picturesAndTables'); - $res_file4 = self::save_article_file($res, $user_res['user_id'], $user_res['account'], $data['totalpage'], 'totalpage'); + // $res_file4 = self::save_article_file($res, $user_res['user_id'], $user_res['account'], $data['totalpage'], 'totalpage'); $res_file3 = self::save_article_file($res, $user_res['user_id'], $user_res['account'], $data['manuscirpt'], 'manuscirpt'); //发送邮件到编辑,提醒有待审文章 @@ -563,7 +563,7 @@ class Special extends Controller //增加usermsg $res_msg = add_usermsg($journal_info['editor_id'], 'New manuscript', '/articleDetailEditor?id=' . $res); - if ($res && $res_author && $transr && $res_file1 && $res_file2 && $res_file3 && $res_file4 && $res_log && $res_msg) { + if ($res && $res_author && $transr && $res_file1 && $res_file2 && $res_file3 && $res_log && $res_msg) { Db::commit(); return json(['code' => 0]); } else { @@ -637,6 +637,9 @@ class Special extends Controller $insert_article_reviewer['editor_act'] = 1; $insert_article_reviewer['ctime'] = time(); $arid = $this->article_reviewer_obj->insertGetId($insert_article_reviewer); + + //修改文章状态->审稿中 + $this->article_obj->where('article_id',$data['article_id'])->update(['state'=>2]); //添加推荐审稿人信息 $insert_recommend['reviewer_id'] = $reviewer_info['user_id']; @@ -732,11 +735,11 @@ class Special extends Controller $res = $this->article_file_obj->where(['file_url' => $url])->find(); if ($res) { return true; - } else if ($type_name == 'picturesAndTables' && $url == '') { + } else if ($type_name == 'picturesAndTables' && trim($url) == '') { return true; - } else if ($type_name == 'coverLetter' && $url == '') { + } else if ($type_name == 'coverLetter' && trim($url) == '') { return true; - } else if ($type_name == 'totalpage' && $url = '') { + } else if ($type_name == 'totalpage' && trim($url) == '') { return true; } $insert_data['article_id'] = $article_id;