Browse Source

优化数据接口

master
wanghongjun 3 years ago
parent
commit
870022fa50
  1. 6
      source/application/common/logic/PassFlow.php

6
source/application/common/logic/PassFlow.php

@ -475,7 +475,7 @@ class PassFlow
$museumWhere = ' "groupId"='."'510'".' and "granularity" = ' . "'{$granularity}'" . ' and "date" = ' . "'{$date}'";
$museumWhere .= ' and "statTime" >= ' . "'{$dateData[$date]['start_time']}'" . ' and "statTime" <= ' . "'{$dateData[$date]['end_time']}'";
$museumRes = $dm->find('bt_passenger_flow_all',$museumWhere,' SUM("noRepeatInNum") as NUM');
$museumRes = $dm->find('bt_passenger_flow_all',$museumWhere,' SUM("flowInNum") as NUM');
$bw_data[$date] = $museumRes['NUM'] ?: 0;
}
$bw_today_incount = isset($bw_data['day']) ? $bw_data['day'] : 0;
@ -638,7 +638,7 @@ class PassFlow
# 图书、文化馆
$start_create_time = date("Y-m-d H:00:00",strtotime('-23 hours'));
$end_create_time = date("Y-m-d H:59:59");
$hoursWhere = ' "group_id" in (' . "'lib001','BAF055')" . ' and "create_time" >= ' . "'{$start_create_time}'"
$hoursWhere = ' "group_id" in (' . "'baz001','BAF055')" . ' and "create_time" >= ' . "'{$start_create_time}'"
. ' and "create_time" <= ' . "'{$end_create_time}'" ;
$hoursRes = $dm->select('bt_library_hours',$hoursWhere);
foreach ($hoursRes as $hoursRow) {
@ -699,7 +699,7 @@ class PassFlow
foreach ($hoursRes as $hoursRow) {
$date = $hoursRow['hour_time']; // 各时间端进馆人数
if (!isset($allTimeData[$date])) continue;
if (!isset($returnData[$hoursRow['group_name']][$allTimeData[$date]])) $returnData[$hoursRow['group_name']][$date] = 0;
if (!isset($returnData[$hoursRow['group_name']][$date])) $returnData[$hoursRow['group_name']][$date] = 0;
$returnData[$hoursRow['group_name']][$date] += $hoursRow['incount'];
}

Loading…
Cancel
Save