From 413ad160c03fb72d935398be77cd15a866f7242a Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Tue, 1 Mar 2022 19:08:29 +0800 Subject: [PATCH] 20201112 --- application/api/controller/Admin.php | 46 +++++++++++++++++++++++++ application/api/controller/Article.php | 2 +- application/api/controller/Chief.php | 2 +- application/api/controller/Reviewer.php | 8 +++-- application/api/controller/Special.php | 6 ---- application/api/controller/User.php | 10 ++++-- 6 files changed, 62 insertions(+), 12 deletions(-) diff --git a/application/api/controller/Admin.php b/application/api/controller/Admin.php index be28023..c5e1d60 100644 --- a/application/api/controller/Admin.php +++ b/application/api/controller/Admin.php @@ -26,6 +26,7 @@ class Admin extends Controller { protected $user_reviewer_info_obj = ''; protected $user_reviewer_obj = ''; protected $user_msg_obj = ''; + protected $article_reviewer_obj = ''; public function __construct(\think\Request $request = null) { parent::__construct($request); @@ -43,6 +44,7 @@ class Admin 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->article_reviewer_obj = Db::name('article_reviewer'); } @@ -50,6 +52,48 @@ class Admin extends Controller { $data = $this->request->post(); return jsonSuccess(['mycode'=>md5($data['mmm'])]); } + + +// public function retest(){ +// $frag = []; +// $emails = $this->user_obj->where("state",0)->group("email")->having("count(*)>1")->column("email"); +// $list = $this->user_obj->where("email","in",$emails)->select(); +// +// +// foreach ($list as $v){ +// $frag[$v['email']][] = $v; +// } +// +// foreach ($frag as $val){ +// $this->aaaaa($val); +// } + +// foreach ($list as $v){ +// $c1 = $this->article_obj->where('user_id',$v['user_id'])->find(); +// $c2 = $this->reviewer_to_journal_obj->where('reviewer_id',$v['user_id'])->where('state',0)->find(); +// if($c1==null&&$c2==null){ +// $frag[] = $v; +// } +// } + + + + +// foreach ($frag as $val){ +// $this->user_obj->where('user_id',$val['user_id'])->delete(); +// } +// } + + +// private function aaaaa($arr){ +// $a = $arr[0]; +// $b = $arr[1]; +// $this->article_obj->where('user_id',$b['user_id'])->update(['user_id'=>$a['user_id']]); +// $this->article_reviewer_obj->where('reviewer_id',$b['user_id'])->update(['reviewer_id'=>$a['user_id']]); +// $this->reviewer_to_journal_obj->where("reviewer_id",$b['user_id'])->update(['reviewer_id'=>$a['user_id'],'account'=>$a['account']]); +// $this->user_reviewer_info_obj->where('reviewer_id',$b['user_id'])->delete(); +// $this->user_obj->where('user_id',$b['user_id'])->delete(); +// } /** * 获取编辑人员列表(分页) @@ -350,6 +394,8 @@ class Admin extends Controller { * 导入reviewer */ public function reviewerImport() { + + die("server stoped"); //接收信息 $data = $this->request->post(); diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index a3aa6f9..0b49468 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -462,7 +462,7 @@ class Article extends Controller { $user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id",$user_info['user_id'])->find(); - if($data['state']==3 && count($transfer_list)>0){//拒绝转投 + if($data['state']==3 && count($transfer_list)>0){ //查询转投期刊信息 $transfer_journal = $this->journal_obj->where('journal_id',$transfer_list[0]['journal_id'])->find(); //转投 diff --git a/application/api/controller/Chief.php b/application/api/controller/Chief.php index f961e56..61bfcd0 100644 --- a/application/api/controller/Chief.php +++ b/application/api/controller/Chief.php @@ -706,7 +706,7 @@ class Chief extends Controller { $article_info = $this->article_obj->where('article_id',$data['article_id'])->find(); $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find(); $board_info = $this->user_obj->where('user_id',$data['board_id'])->find(); - $board_rev_info = $this->user_reviewer_info_obj->where("reviewer_id",$board_info['user_id'])->find(); +// $board_rev_info = $this->user_reviewer_info_obj->where("reviewer_id",$board_info['user_id'])->find(); $check = $this->article_to_board_obj->where('article_id',$data['article_id'])->where('board_id',$data['board_id'])->find(); if($check!=null){ return jsonError('Applied!'); diff --git a/application/api/controller/Reviewer.php b/application/api/controller/Reviewer.php index 6928358..291398d 100644 --- a/application/api/controller/Reviewer.php +++ b/application/api/controller/Reviewer.php @@ -829,6 +829,10 @@ class Reviewer extends Controller { $re['icon'] = 'reviewerZS' . DS . $data['art_rev_id'] . '.jpg'; return jsonSuccess($re); } + + + + /** * 创建证书方法 @@ -850,7 +854,7 @@ class Reviewer extends Controller { ->text('awarded ' . date('d, F, Y', $article_info['rtime'] == 0 ? $article_info['ctime'] : $article_info['rtime']) . ' to', $ziti, 60, '#000000', [1600, 1500]) ->text('In recognitioin of the review made for the journal', $ziti, 80, '#000000', [900, 1900]) ->text('The Editors of', $ziti, 65, '#000000', [230, 2345]) - ->text($journal_info['title'], $ziti, 60, '#000000', [910, 2345]) + ->text($journal_info['title'], $ziti, 60, '#000000', [830, 2345]) ->text('Cockle Bay Rd, Auckland, New Zealand, 2014', $ziti, 60, '#000000', [230, 2500]) ->save(ROOT_PATH . 'public' . DS . 'reviewerZS' . DS . $art_rev_id . '.jpg'); } @@ -1264,7 +1268,7 @@ class Reviewer extends Controller { $info_insert['cmajor'] = $data['cmajor']; $info_insert['field'] = trim($data['field']); $info_insert['qualifications'] = trim($data['cv']); - if ($reviewer_info != null) { + if ($reviewer_info == null) { $this->user_reviewer_info_obj->insertGetId($info_insert); } else { $this->user_reviewer_info_obj->where('reviewer_info_id', $reviewer_info['reviewer_info_id'])->update($info_insert); diff --git a/application/api/controller/Special.php b/application/api/controller/Special.php index 713504e..3bdbf02 100644 --- a/application/api/controller/Special.php +++ b/application/api/controller/Special.php @@ -48,12 +48,6 @@ class Special extends Controller { public function register() { $data = $this->request->post(); -// $data['username'] = '123'; -// $data['password'] = '123123'; -// $data['realname'] = '123'; -// $data['phone'] = '12312312312'; -// $data['email'] = '123@123.com'; -// //检测是否用户名和密码已经占用 $account = $data['username']; $email = $data['email']; diff --git a/application/api/controller/User.php b/application/api/controller/User.php index 30cb458..f9fa502 100644 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -662,6 +662,12 @@ class User extends Controller { return jsonError("user no find!"); } + $check = $this->reviewer_to_journal_obj->where("journal_id",$journal_info['journal_id'])->where('reviewer_id',$user_info['user_id'])->where('state',0)->find(); + + if($check){ + return jsonError("has reviewer"); + } + Db::startTrans(); $insert_info['reviewer_id'] = $user_info['user_id']; @@ -711,14 +717,14 @@ class User extends Controller { } /** - * 通过审核人 + * 通过审稿人 */ public function reviewerAdopt() { $reviewerId = $this->request->post('reviewerApplyId'); $where['reviewer_apply_id'] = $reviewerId; $apply_info = $this->user_reviewer_obj->where($where)->find(); $journal_info = $this->journal_obj->where('journal_id', $apply_info['journal_id'])->find(); - $has_res = $this->user_obj->where('account', $apply_info['name'])->find(); + $has_res = $this->user_obj->where('account', $apply_info['name'])->whereOr("email",$apply_info['email'])->find(); //检测是否已经存在此审稿人 if($has_res){ $check = $this->reviewer_to_journal_obj->where('reviewer_id',$has_res['user_id'])->where('journal_id',$journal_info['journal_id'])->where('state',0)->find();