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){ //文章提交至接收超过48小时 $t48 = $this->article_obj->where('journal_id',$v['journal_id'])->where('state',0)->count(); //文章接受时间小于15天 //文章接收时间大于120天 //with editor时间超过三天(预留) $cache_list = $this->article_obj->where('journal_id',$v['journal_id'])->where('state',5)->select(); } } }