月计数
This commit is contained in:
parent
e8e8b97195
commit
35b077afa9
@ -117,6 +117,7 @@ if ($act == 'newevent') {
|
|||||||
|
|
||||||
$startDate = date('Y-m-d', $start);
|
$startDate = date('Y-m-d', $start);
|
||||||
$endDate = date('Y-m-d', $end);
|
$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}";
|
$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
|
'修复外网' => 0
|
||||||
|
|
||||||
|
|
||||||
|
);
|
||||||
|
$eventTypeCntMonth = array(
|
||||||
|
'节点' => 0,
|
||||||
|
'打包' => 0,
|
||||||
|
'版本更新' => 0,
|
||||||
|
'上线' => 0,
|
||||||
|
'修复外网' => 0
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
$eventCount = array(
|
$eventCount = array(
|
||||||
'总更新&总修复' => array(
|
'总更新&总修复' => array(
|
||||||
@ -147,6 +157,10 @@ if ($act == 'newevent') {
|
|||||||
}
|
}
|
||||||
$eventTypeCnt[$rs['event']] += 1;
|
$eventTypeCnt[$rs['event']] += 1;
|
||||||
|
|
||||||
|
if (strstr($rs['end'], $month)) {
|
||||||
|
$eventTypeCntMonth[$rs['event']] += 1;
|
||||||
|
}
|
||||||
|
|
||||||
$class = "light";
|
$class = "light";
|
||||||
if ($rs['event'] == '节点') {
|
if ($rs['event'] == '节点') {
|
||||||
$class = "success";
|
$class = "success";
|
||||||
@ -223,7 +237,7 @@ if ($act == 'newevent') {
|
|||||||
// we(json_encode($eventCharts));
|
// we(json_encode($eventCharts));
|
||||||
we(json_encode(array('charts' => $eventCharts, 'table' => $eventTable,'count'=>$eventTypeCnt)));
|
we(json_encode(array('charts' => $eventCharts, 'table' => $eventTable,'count'=>$eventTypeCnt)));
|
||||||
else{
|
else{
|
||||||
$json['count'] = $eventTypeCnt;
|
$json['count'] = $eventTypeCntMonth;
|
||||||
we(json_encode($json));
|
we(json_encode($json));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user