|
|
@ -414,4 +414,45 @@ class PassFlow |
|
|
|
|
|
|
|
|
return $data; |
|
|
return $data; |
|
|
} |
|
|
} |
|
|
|
|
|
/** |
|
|
|
|
|
* 24小时各场馆数据 |
|
|
|
|
|
* @return array |
|
|
|
|
|
*/ |
|
|
|
|
|
public static function getPassHoursData($dm = null,$param = []) |
|
|
|
|
|
{ |
|
|
|
|
|
if (empty($dm)) $dm = new Dm(); |
|
|
|
|
|
|
|
|
|
|
|
$where = ' "granularity"='."'hourly' "; |
|
|
|
|
|
if (!empty($param)) { |
|
|
|
|
|
if (!empty($param['groupsId'])) { |
|
|
|
|
|
$groupsId = explode("|",$param['groupsId']); |
|
|
|
|
|
$where .= ' and "groupId" in (' . "'" . implode("','",$groupsId) . "')"; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
$date = self::getDateData('day'); |
|
|
|
|
|
$start_time = $date['day']['start_time']; |
|
|
|
|
|
$end_time = $date['day']['end_time']; |
|
|
|
|
|
$where .= ' and "statTime" >= ' . "'{$start_time}'" . ' and "statTime" <= ' . "'{$end_time}'"; |
|
|
|
|
|
$list = $dm->select('bt_passenger_flow',$where); |
|
|
|
|
|
$allTimeData = []; |
|
|
|
|
|
for ($i = 0; $i < 23; $i++) { |
|
|
|
|
|
$str = strlen($i) == 1 ? '0'.$i.':00' : $i.':00'; |
|
|
|
|
|
$allTimeData[$str] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
$returnData = []; |
|
|
|
|
|
foreach ($list as $value) { |
|
|
|
|
|
$date = date('H:00',strtotime($value['statTime']) + (8*3600)); // 各时间端进馆人数 |
|
|
|
|
|
if (!isset($allTimeData[$date])) continue; |
|
|
|
|
|
if (!isset($returnData[$allTimeData[$date]])) $returnData[$allTimeData[$date]] = 0; |
|
|
|
|
|
$returnData[$allTimeData[$date]] += $value['noRepeatInNum']; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$data = []; |
|
|
|
|
|
foreach ($returnData as $date => $item) { |
|
|
|
|
|
|
|
|
|
|
|
$data['dkeys'][] = $date; |
|
|
|
|
|
$data['dvalue'][] = $item; |
|
|
|
|
|
} |
|
|
|
|
|
return $data; |
|
|
|
|
|
} |
|
|
} |
|
|
} |