From c043e5318a92fbf9543d4aa4604b317ca7588f04 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Tue, 23 Jan 2024 14:21:06 +0800 Subject: [PATCH] 1 --- application/api/controller/Monitor.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/application/api/controller/Monitor.php b/application/api/controller/Monitor.php index 7961437..f0f752f 100644 --- a/application/api/controller/Monitor.php +++ b/application/api/controller/Monitor.php @@ -137,6 +137,10 @@ class Monitor extends Base $dn = $this->getDN($v['journal_id'],date("Y")); $journals[$k]['ZS'] = $dn['zs']; $journals[$k]['CS'] = $dn['cs']; + //当年投稿情况 + $nare = $this->getNZT($v['journal_id'],date("Y")-1); + $journals[$k]['NZ'] = $nare['z']; + $journals[$k]['NZT'] = $nare['zt']; } $re['journals'] = $journals; @@ -254,4 +258,16 @@ class Monitor extends Base $re['z'] = count($articles); return $re; } + + + private function getNZT($journal_id,$y){ + $start = strtotime(date($y."-01-01 00:00:00")); + $end = strtotime(date($y."-12-31 23:59:59")); + $journal_info = $this->journal_obj->where('journal_id',$journal_id)->find(); + $articles = $this->article_obj->where('accept_sn',"like",$journal_info['abbr']."%")->where('ctime',">",$start)->where("ctime","<",$end)->select(); + $zt_articles = $this->article_obj->where('accept_sn',"not like",$journal_info['abbr']."%")->where('ctime',">",$start)->where('journal_id',$journal_id)->where("ctime","<",$end)->select(); + $re['zt'] =count($zt_articles); + $re['z'] = count($articles); + return $re; + } } \ No newline at end of file