This commit is contained in:
wangjinlei
2021-04-08 10:50:40 +08:00
parent e31c67e77c
commit 11da1a782b
3 changed files with 53 additions and 19 deletions

View File

@@ -42,9 +42,23 @@ class Super extends Controller{
$this->staff_to_journal_obj = Db::name('staff_to_journal');
}
public function index() {
$res = $this->getLYL(1);
echo ($res*100).'%';
public function main() {
$list = $this->journal_obj->where('state',0)->select();
foreach ($list as $k => $v){
$list[$k]['LYL'] = $this->getLYL($v['journal_id']);
$list[$k]['CC'] = $this->getCC($v['journal_id']);
$list[$k]['WS'] = $this->getWS($v['journal_id']);
$list[$k]['SJ'] = $this->getSJ($v['journal_id']);
}
return jsonSuccess($list);
}
public function getAllArticle(){
$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();
}
return jsonSuccess($list);
}
@@ -53,6 +67,8 @@ class Super extends Controller{
*/
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();
$js = 0;
$jj = 0;
foreach ( $res as $v){
if($v['state']==3){
$jj = $v['num'];
@@ -69,18 +85,22 @@ class Super extends Controller{
private function getCC($journalId){
$res = $this->article_obj->where('journal_id',$journalId)->where('state',5)->select();
$low = 0;
$low1 = 0;
$mid = 0;
$high = 0;
foreach ($res as $v){
if($v['repetition']<20){
$low++;
}elseif($v['repetition']>=20 && $v['repetition']<50){
}elseif($v['repetition']>=20 && $v['repetition']<30){
$low1++;
}elseif($v['repetition']>=30 && $v['repetition']<50){
$mid++;
}else{
$high++;
}
}
$re['low'] = $low;
$re['low1'] = $low1;
$re['mid'] = $mid;
$re['high'] = $high;
@@ -109,20 +129,17 @@ class Super extends Controller{
* 获取时间异常
*/
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();
}
//文章提交至接收超过48小时
$res['t48'] = $this->article_obj->where('journal_id',$journalId)->where('state',0)->count();
//文章接受时间小于15天
$res['j15'] = $this->article_obj->where('journal_id',$journalId)->where('state',5)->where('rtime','>',0)->where('(rtime-ctime)','<',3600*24*15)->count();
//文章接时间于120
$res['j120'] = $this->article_obj->where('journal_id',$journalId)->where('state',5)->where('rtime','>',0)->where('(rtime-ctime)','>',3600*24*120)->count();
//with editor时间超过三天预留
//获取全部总数
$res['al'] = $this->article_obj->where('journal_id',$journalId)->count();
return $res;
}
}