From 35b077afa9650f6452944fe0ecad3d961a094ece Mon Sep 17 00:00:00 2001 From: kf_wuhao <15392746632@qq.com> Date: Mon, 4 Jan 2021 14:15:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=88=E8=AE=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pmcalendar.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pmcalendar.php b/pmcalendar.php index 656af1b..1ca1352 100644 --- a/pmcalendar.php +++ b/pmcalendar.php @@ -117,6 +117,7 @@ if ($act == 'newevent') { $startDate = date('Y-m-d', $start); $endDate = date('Y-m-d', $end); + $month = date('Y-m', ($start + $end) / 2); $sql = "select * from calendar where ((start>='{$startDate}' and start<='{$endDate}') or (end>='{$startDate}' and end<='{$endDate}')) {$where}"; @@ -129,6 +130,15 @@ if ($act == 'newevent') { '修复外网' => 0 + ); + $eventTypeCntMonth = array( + '节点' => 0, + '打包' => 0, + '版本更新' => 0, + '上线' => 0, + '修复外网' => 0 + + ); $eventCount = array( '总更新&总修复' => array( @@ -147,6 +157,10 @@ if ($act == 'newevent') { } $eventTypeCnt[$rs['event']] += 1; + if (strstr($rs['end'], $month)) { + $eventTypeCntMonth[$rs['event']] += 1; + } + $class = "light"; if ($rs['event'] == '节点') { $class = "success"; @@ -223,7 +237,7 @@ if ($act == 'newevent') { // we(json_encode($eventCharts)); we(json_encode(array('charts' => $eventCharts, 'table' => $eventTable,'count'=>$eventTypeCnt))); else{ - $json['count'] = $eventTypeCnt; + $json['count'] = $eventTypeCntMonth; we(json_encode($json)); } }