From 11da1a782be69c50d85216da7d6b6a81939cf628 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Thu, 8 Apr 2021 10:50:40 +0800 Subject: [PATCH] 20201112 --- application/api/controller/Article.php | 4 +- application/api/controller/Super.php | 53 +++++++++++++++++--------- application/api/controller/User.php | 15 ++++++++ 3 files changed, 53 insertions(+), 19 deletions(-) diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index c0528e5..cff664b 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -850,6 +850,7 @@ class Article extends Controller { } } + /** * 作者发送消息 */ @@ -971,7 +972,8 @@ class Article extends Controller { $journal_info = $this->journal_obj->where('issn',$data['issn'])->find(); $list = $this->article_obj ->where('journal_id',$journal_info['journal_id']) - ->where('ctime','>',$data['ctime']) + ->where('state','in','0,1,2,4') +// ->where('ctime','>',$data['ctime']) ->select(); $re['articles'] = $list; diff --git a/application/api/controller/Super.php b/application/api/controller/Super.php index fd68fde..ea1b99b 100644 --- a/application/api/controller/Super.php +++ b/application/api/controller/Super.php @@ -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; } } diff --git a/application/api/controller/User.php b/application/api/controller/User.php index 27fbf99..eb08be9 100644 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -121,6 +121,21 @@ class User extends Controller { sendEmail($email, 'Dear ' . $data['name'], 'TMR', $tt,); return json($inser_data); } + +// public function tttt(){ +// echo 'dsss'; +// } +// +// public function mytestemail(){ +// $journal_info = $this->journal_obj->where('journal_id',22)->find(); +// //发送注册成功邮件 +// $tt = 'Hello,

'; +// $res = sendEmail('751475802@qq.com', 'Dear ' . $journal_info['title'], 'TMR', $tt,$journal_info['email'],$journal_info['epassword']); +// echo '
';
+//        var_dump($res);
+//        echo '
'; +// die; +// } /** * 获取验证码图片(用户注册)