From f648752c1644b2684a3066d86e3e82483b568a12 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Wed, 13 Mar 2024 16:29:30 +0800 Subject: [PATCH] 1 --- application/api/controller/Monitor.php | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/application/api/controller/Monitor.php b/application/api/controller/Monitor.php index 6f7c1f3..e9f795c 100644 --- a/application/api/controller/Monitor.php +++ b/application/api/controller/Monitor.php @@ -66,6 +66,50 @@ class Monitor extends Base return jsonSuccess($re); } + + /**获取期刊年度总投稿量 + * @return void + */ + public function getArticleNumByYear(){ + $year = 2020; + $frag = []; + while ($year<=date("Y")){ + $s_time = strtotime($year."-1-1"); + $e_time = strtotime($year."-12-31"); + $n = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->count(); + $frag[$year] = $n; + $year++; + } + $re['articles'] = $frag; + return jsonSuccess($re); + } + + + /**获取期刊月投稿量 + * @return bool + */ + public function getArticleNumByMonth() + { + $year = 2020; + $month = 8; + $frag = []; + while ($yeararticle_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->count(); + $frag[$year."-".$month] = $n; + if($month==12){ + $year++; + $month =1; + }else{ + $month++; + } + } + $re['articles'] = $frag; + return jsonSuccess($re); + } + + /**获取期刊青年编委 * @return void */