From 657ebbf44999502ce4599c3bd1a4c4faa939a975 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Fri, 14 May 2021 11:01:06 +0800 Subject: [PATCH] 20201112 --- application/api/controller/Admin.php | 5 ++- application/api/controller/Article.php | 50 ++++++++++++++++++++++++ application/api/controller/Staff.php | 1 - application/api/controller/Super.php | 54 ++++++++++++++++++++++---- 4 files changed, 99 insertions(+), 11 deletions(-) diff --git a/application/api/controller/Admin.php b/application/api/controller/Admin.php index 42bdccd..3a859fa 100644 --- a/application/api/controller/Admin.php +++ b/application/api/controller/Admin.php @@ -363,12 +363,13 @@ class Admin extends Controller { } //验证是否存在此用户并且存在对应关系 $this_reviewer = self::get_username($v['username']); - if ($this_reviewer == null && self::get_userByEmail($v['email']) != null) { + $mme = self::get_userByEmail($v['email']); + if ($this_reviewer == null && $mme != null) { $er_data[] = [ 'username' => $v['username'], 'realname' => $v['realname'], 'email' => $v['email'], - 'reason' => 'Email occupied' + 'reason' => 'Email occupied,and username is:'.$mme['account'] ]; continue; } diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index a5cebc2..2199a4d 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -14,6 +14,7 @@ class Article extends Controller { protected $user_log_obj = ''; protected $reviewer_major_obj = ''; protected $reviewer_to_journal_obj = ''; + protected $article_reviewer_question_obj = ''; protected $article_msg_obj = ''; protected $article_file_obj = ''; protected $article_reviewer_obj = ''; @@ -29,6 +30,7 @@ class Article extends Controller { $this->user_log_obj = Db::name('user_log'); $this->reviewer_major_obj = Db::name('reviewer_major'); $this->reviewer_to_journal_obj = Db::name('reviewer_to_journal'); + $this->article_reviewer_question_obj = Db::name('article_reviewer_question'); $this->article_msg_obj = Db::name('article_msg'); $this->article_file_obj = Db::name('article_file'); $this->article_reviewer_obj = Db::name('article_reviewer'); @@ -708,6 +710,54 @@ class Article extends Controller { return json(['code' => 0]); } + + /** + * 编辑添加审稿实例(临时开启,为了补充审稿实例不够) + */ + public function addArtRev(){ + $data = $this->request->post(); + + //增加信息到文章审稿表 + $insert['reviewer_id'] = $data['uid']; + $insert['article_id'] = $data['articleId']; + $insert['ctime'] = time(); + $insert['state'] = 3; + $art_rev_id = $this->article_reviewer_obj->insertGetId($insert); + + //添加问卷信息 + $insert_data['art_rev_id'] = $art_rev_id; + $insert_data['qu1'] = $data['qu1']; + $insert_data['qu2'] = $data['qu2']; + $insert_data['qu3'] = $data['qu3']; + $insert_data['qu4'] = $data['qu4']; + $insert_data['qu5'] = $data['qu5']; + $insert_data['qu6'] = $data['qu6']; + $insert_data['qu7'] = $data['qu7']; + $insert_data['qu8'] = $data['qu8']; + $insert_data['qu9'] = $data['qu9']?1:0; + $insert_data['qu9_contents'] = $data['qu9contents']; + $insert_data['qu10'] = $data['qu10']?1:0; + $insert_data['qu10_contents'] = $data['qu10contents']; + $insert_data['qu11'] = $data['qu11']?1:0; + $insert_data['qu11_contents'] = $data['qu11contents']; + $insert_data['qu12'] = $data['qu12']?1:0; + $insert_data['qu12_contents'] = $data['qu12contents']; + $insert_data['qu13'] = $data['qu13']?1:0; + $insert_data['qu13_contents'] = $data['qu13contents']; + $insert_data['qu14'] = $data['qu14']?1:0; + $insert_data['qu14_contents'] = $data['qu14contents']; + $insert_data['qu15'] = $data['qu15']?1:0; + $insert_data['qu15_contents'] = $data['qu15contents']; + $insert_data['rated'] = $data['rated']; + $insert_data['recommend'] = $data['recommend']; + $insert_data['other'] = $data['other']; + $insert_data['confidential'] = $data['confident']; + $insert_data['comments'] = $data['comment']; + $insert_data['ctime'] = time(); + $res = $this->article_reviewer_question_obj->insert($insert_data); + $re['code'] = 0; + return json($re); + } /** * 添加文章(作者) diff --git a/application/api/controller/Staff.php b/application/api/controller/Staff.php index b848f75..173789e 100644 --- a/application/api/controller/Staff.php +++ b/application/api/controller/Staff.php @@ -209,7 +209,6 @@ class Staff extends Controller { ->join('t_staff', 't_journal.staff_id = t_staff.staff_id', 'left') ->where('t_journal.state', 0) ->select(); - $re['journals'] = $list; return jsonSuccess($re); } diff --git a/application/api/controller/Super.php b/application/api/controller/Super.php index eb7a64d..48d0206 100644 --- a/application/api/controller/Super.php +++ b/application/api/controller/Super.php @@ -57,9 +57,14 @@ class Super extends Controller{ } public function getAllArticle(){ + $data = $this->request->post(); $list = $this->journal_obj->where('state',0)->select(); foreach ($list as $k => $v){ - $list[$k]['SJ'] = $this->article_obj->where('journal_id',$v['journal_id'])->count(); + $list[$k]['SJ'] = $this->article_obj + ->where('journal_id',$v['journal_id']) + ->where('ctime','>',$data['start']) + ->where('ctime','<=',$data['end']) + ->count(); } return jsonSuccess($list); } @@ -91,7 +96,6 @@ class Super extends Controller{ $re['articles'] = $list; return jsonSuccess($re); } - /** * 获取录用率 @@ -105,6 +109,12 @@ class Super extends Controller{ ->where('state','in','3,5') ->group('state') ->select(); + //获取全部总数 + $all = $this->article_obj + ->where('journal_id',$journalId) + ->where('ctime','>',$start_time) + ->where('ctime','<',$end_time) + ->count(); $js = 0; $jj = 0; foreach ( $res as $v){ @@ -114,7 +124,7 @@ class Super extends Controller{ $js = $v['num']; } } - return $js+$jj==0?0:$js/($js+$jj); + return $all==0?0:$js/$all; } /** @@ -157,6 +167,8 @@ class Super extends Controller{ $res = $this->article_obj ->where('journal_id',$journalId) ->where('state',5) + ->where('type','<>','N') + ->where('type','<>','T') ->where('ctime','>',$start_time) ->where('ctime','<',$end_time) ->select(); @@ -173,6 +185,26 @@ class Super extends Controller{ return $re; } + public function mutest(){ + $start_time = strtotime('2021-01-01'); + $end_time = strtotime('2021-04-15 23:59:59'); + $res = $this->getSJ(1, $start_time, $end_time); + echo '
'; + var_dump($res); + echo ''; + die; + } + + public function mmmyyy(){ + $start = strtotime('2021-01-01'); + $end = strtotime('2021-04-22 11:30:12'); + $res = $this->getSJ(8, $start, $end); + echo '
'; + var_dump($res); + echo ''; + die; + } + /** * 获取时间异常 */ @@ -191,7 +223,7 @@ class Super extends Controller{ ->where('ctime','<',$end_time) ->where('state',5) ->where('rtime','>',0) - ->where('(rtime-ctime)','<',3600*24*15) + ->where('(rtime-ctime) <'.(3600*24*15)) ->count(); //文章接收时间大于120天 $res['j120'] = $this->article_obj @@ -199,17 +231,23 @@ class Super extends Controller{ ->where('state',5) ->where('ctime','>',$start_time) ->where('ctime','<',$end_time) - ->where('rtime','>',0) - ->where('(rtime-ctime)','>',3600*24*120) - ->count(); + ->where('rtime','>',0) + ->where('(rtime-ctime) > '.(3600*24*120)) + ->count(); //with editor时间超过三天(预留) + $journal_info = $this->journal_obj->where('journal_id',$journalId)->find(); + $zc_num = $this->article_obj->where('accept_sn','like',$journal_info['abbr'].'%')->where('journal_id','<>',$journalId)->where('ctime','>',$start_time)->where('ctime','<',$end_time)->count(); + $zr_num = $this->article_obj->where('accept_sn','not like',$journal_info['abbr'].'%')->where('journal_id',$journalId)->where('ctime','>',$start_time)->where('ctime','<',$end_time)->count(); //获取全部总数 - $res['al'] = $this->article_obj + $mq_num = $this->article_obj ->where('journal_id',$journalId) ->where('ctime','>',$start_time) ->where('ctime','<',$end_time) ->count(); + $res['mq'] = $mq_num;//文章总数 + $res['zc'] = $zc_num;//转出文章数 + $res['zr'] = $zr_num;//转入文章数 return $res; }