From 1442a65c3bf142842c389ba45ecca93c1479cd32 Mon Sep 17 00:00:00 2001 From: wuhao <15392746632@qq.com> Date: Tue, 15 Dec 2020 11:36:40 +0800 Subject: [PATCH] update --- pmcalendar.php | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/pmcalendar.php b/pmcalendar.php index 9a0cc6b..d988bfb 100644 --- a/pmcalendar.php +++ b/pmcalendar.php @@ -108,7 +108,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}"; $rss = DB::getArray($sql); @@ -136,9 +136,8 @@ if ($act == 'newevent') { 'purpleCount' => 0 ); } - if (strstr($rs['end'], $month)) { - $eventTypeCnt[$rs['event']] += 1; - } + $eventTypeCnt[$rs['event']] += 1; + $class = "light"; if ($rs['event'] == '节点') { $class = "success"; @@ -146,18 +145,14 @@ if ($act == 'newevent') { $class = "warning"; } elseif ($rs['event'] == '版本更新') { $class = "danger"; - if (strstr($rs['end'], $month)) { - $eventCount[$rs['game']]['dangerCount'] += 1; - $eventCount['总更新&总修复']['dangerCount'] += 1; - } + $eventCount[$rs['game']]['dangerCount'] += 1; + $eventCount['总更新&总修复']['dangerCount'] += 1; } elseif ($rs['event'] == '上线') { $class = "pink"; } elseif ($rs['event'] == '修复外网') { $class = "purple"; - if (strstr($rs['end'], $month)) { - $eventCount[$rs['game']]['purpleCount'] += 1; - $eventCount['总更新&总修复']['purpleCount'] += 1; - } + $eventCount[$rs['game']]['purpleCount'] += 1; + $eventCount['总更新&总修复']['purpleCount'] += 1; } $gameName = $rs['game'];