From 5ef27073bb9e34037f557d6b08437052740efe97 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Mon, 29 Mar 2021 15:47:22 +0800 Subject: [PATCH] 20201112 --- application/api/controller/Staff.php | 8 +- application/api/controller/Super.php | 119 +++++++++++++++++++++++++++ 2 files changed, 123 insertions(+), 4 deletions(-) create mode 100644 application/api/controller/Super.php diff --git a/application/api/controller/Staff.php b/application/api/controller/Staff.php index 7608c47..879abd3 100644 --- a/application/api/controller/Staff.php +++ b/application/api/controller/Staff.php @@ -283,10 +283,10 @@ class Staff extends Controller { * 获取员工工资信息列表(管理员用) */ public function getAllStaff() { -// $data = $this->request->post(); - $data['pageIndex'] = 1; - $data['pageSize'] = 100; - $data['date'] = '202103'; + $data = $this->request->post(); +// $data['pageIndex'] = 1; +// $data['pageSize'] = 100; +// $data['date'] = '202103'; $limit_start = ($data['pageIndex'] - 1) * $data['pageSize']; $staff_list = $this->staff_obj->where('state', 0)->limit($limit_start, $data['pageSize'])->select(); diff --git a/application/api/controller/Super.php b/application/api/controller/Super.php new file mode 100644 index 0000000..eb4ba4b --- /dev/null +++ b/application/api/controller/Super.php @@ -0,0 +1,119 @@ +user_obj = Db::name('user'); + $this->user_act_obj = Db::name('user_act'); + $this->article_obj = Db::name('article'); + $this->journal_obj = Db::name('journal'); + $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_msg_obj = Db::name('article_msg'); + $this->article_file_obj = Db::name('article_file'); + $this->article_reviewer_obj = Db::name('article_reviewer'); + $this->article_author_obj = Db::name('article_author'); + $this->article_transfer_obj = Db::name('article_transfer'); + $this->staff_obj = Db::name('staff'); + $this->staff_level_obj = Db::name('staff_level'); + $this->staff_log_obj = Db::name('staff_log'); + $this->staff_to_journal_obj = Db::name('staff_to_journal'); + } + + public function index() { + $res = $this->getLYL(1); + echo ($res*100).'%'; + } + + + /** + * 获取录用率 + */ + private function getLYL($journalId){ + $res = $this->article_obj->field('state,count(state) as num')->where('journal_id',$journalId)->where('state','in','3,5')->group('state')->select(); + foreach ( $res as $v){ + if($v['state']==3){ + $jj = $v['num']; + } else { + $js = $v['num']; + } + } + return $js/($js+$jj); + } + + /** + * 获取查重异常 + */ + private function getCC($journalId){ + $res = $this->article_obj->where('journal_id',$journalId)->where('state',5)->select(); + $low = 0; + $mid = 0; + $high = 0; + foreach ($res as $v){ + if($v['repetition']<20){ + $low++; + }elseif($v['repetition']>=20 && $v['repetition']<50){ + $mid++; + }else{ + $high++; + } + } + $re['low'] = $low; + $re['mid'] = $mid; + $re['high'] = $high; + + return $re; + } + + /** + * 获取外审异常 + */ + private function getWS($journalId){ + $res = $this->article_obj->where('journal_id',$journalId)->where('state',5)->select(); + $np =0; + foreach ( $res as $v){ + $ca = $this->article_reviewer_obj->where('article_id',$v['article_id'])->count(); + if($ca<2){ + $np++; + } + } + + $re['all'] = count($res); + $re['np'] = $np; + return $re; + } + + /** + * 获取时间异常 + */ + private function getSJ($journalId){ + $res = $this->article_obj->where('journal_id',$journalId)->where('state',5)->select(); + foreach ($res as $v){ + + } + + } + +}