|
|
@ -86,7 +86,7 @@ class PassFlow |
|
|
} |
|
|
} |
|
|
if ($date == 'week' || $date == 'all') { |
|
|
if ($date == 'week' || $date == 'all') { |
|
|
$data['week'] = [ |
|
|
$data['week'] = [ |
|
|
'start_time' => date("Y-m-d",strtotime("+".(date("w") - 7) . "day")) . 'T00:00:00.000+08:00', |
|
|
'start_time' => date("Y-m-d",strtotime('this week')) . 'T00:00:00.000+08:00', |
|
|
'end_time' => date("Y-m-d",strtotime("-".(date("w") - 7) . "day")) . 'T23:59:59.000+08:00' |
|
|
'end_time' => date("Y-m-d",strtotime("-".(date("w") - 7) . "day")) . 'T23:59:59.000+08:00' |
|
|
]; |
|
|
]; |
|
|
} |
|
|
} |
|
|
@ -260,6 +260,20 @@ class PassFlow |
|
|
$sumFind = $dm->find('bt_passenger_flow_all', $sumWhere,'SUM("flowInNum") as NUM'); |
|
|
$sumFind = $dm->find('bt_passenger_flow_all', $sumWhere,'SUM("flowInNum") as NUM'); |
|
|
$returnData['sumYear']['noRepeatInNum'] = isset($sumFind['NUM']) ? $sumFind['NUM'] : 0; |
|
|
$returnData['sumYear']['noRepeatInNum'] = isset($sumFind['NUM']) ? $sumFind['NUM'] : 0; |
|
|
|
|
|
|
|
|
|
|
|
if (empty($param['groupsId'])) { |
|
|
|
|
|
# 文化数据 |
|
|
|
|
|
$mData = $dm->find('bt_library',['group_id' => 'lib001']); |
|
|
|
|
|
$returnData['day']['noRepeatInNum'] += isset($mData['today_incount']) ? $mData['today_incount'] : 0; |
|
|
|
|
|
$returnData['month']['noRepeatInNum'] += isset($mData['month_incount']) ? $mData['month_incount'] : 0; |
|
|
|
|
|
$returnData['year']['noRepeatInNum'] += isset($mData['year_incount']) ? $mData['year_incount'] : 0; |
|
|
|
|
|
$returnData['sumYear']['noRepeatInNum'] += isset($mData['year_incount']) ? $mData['year_incount'] : 0; |
|
|
|
|
|
$week_start = date("Y-m-d 00:00:00",strtotime('this week')); |
|
|
|
|
|
$week_end = date("Y-m-d 23:59:59",strtotime("-".(date("w") - 7) . "day")); |
|
|
|
|
|
$weekDateWhere = ' "group_id" =' . "'lib001'" . ' and "create_time" >= ' . "'{$week_start}'" . ' and "create_time" <= ' . "'{$week_end}'"; |
|
|
|
|
|
$weekDate = $dm->find('bt_library_hours',$weekDateWhere,'SUM("incount") as NUM'); |
|
|
|
|
|
$returnData['week']['noRepeatInNum'] += isset($weekDate['NUM']) ? $weekDate['NUM'] : 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
foreach ($returnData as &$val) { |
|
|
foreach ($returnData as &$val) { |
|
|
$val['noRepeatInNum'] = formatNumber($val['noRepeatInNum']); |
|
|
$val['noRepeatInNum'] = formatNumber($val['noRepeatInNum']); |
|
|
} |
|
|
} |
|
|
@ -409,6 +423,7 @@ class PassFlow |
|
|
'list' => $listData |
|
|
'list' => $listData |
|
|
]; |
|
|
]; |
|
|
} |
|
|
} |
|
|
|
|
|
$data = self::getLibraryGroupHoursList($dm,false,$data); |
|
|
|
|
|
|
|
|
return $data; |
|
|
return $data; |
|
|
} |
|
|
} |
|
|
@ -621,15 +636,17 @@ class PassFlow |
|
|
* @throws \think\db\exception\ModelNotFoundException |
|
|
* @throws \think\db\exception\ModelNotFoundException |
|
|
* @throws \think\exception\DbException |
|
|
* @throws \think\exception\DbException |
|
|
*/ |
|
|
*/ |
|
|
public static function getLibraryGroupHoursList($dm = null) |
|
|
public static function getLibraryGroupHoursList($dm = null,$is_group = true,$data = []) |
|
|
{ |
|
|
{ |
|
|
if (empty($dm)) $dm = new Dm(); |
|
|
if (empty($dm)) $dm = new Dm(); |
|
|
|
|
|
|
|
|
# 获取文化组id |
|
|
# 获取文化组id |
|
|
|
|
|
if ($is_group) { |
|
|
$groupRes = $dm->select('bt_passenger_monitor_group',['type' => 2],'"groupId","groupName"'); |
|
|
$groupRes = $dm->select('bt_passenger_monitor_group',['type' => 2],'"groupId","groupName"'); |
|
|
$groupsId = []; |
|
|
$groupsId = []; |
|
|
foreach ($groupRes as $groupRow) $groupsId[] = $groupRow['groupId']; |
|
|
foreach ($groupRes as $groupRow) $groupsId[] = $groupRow['groupId']; |
|
|
$data = self::toDayGroupsEnterNum($dm,['groupsId' => implode("|",$groupsId)]); |
|
|
$data = self::toDayGroupsEnterNum($dm,['groupsId' => implode("|",$groupsId)]); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
# 图书、文化馆 |
|
|
# 图书、文化馆 |
|
|
$start_create_time = date("Y-m-d 00:00:00"); |
|
|
$start_create_time = date("Y-m-d 00:00:00"); |
|
|
@ -673,4 +690,28 @@ class PassFlow |
|
|
|
|
|
|
|
|
return $data; |
|
|
return $data; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 获取今日图书馆借阅、办证数据 |
|
|
|
|
|
* @param $dm |
|
|
|
|
|
* @return int[] |
|
|
|
|
|
*/ |
|
|
|
|
|
public static function getLibraryLeaseData($dm = null) |
|
|
|
|
|
{ |
|
|
|
|
|
if (empty($dm)) $dm = new Dm(); |
|
|
|
|
|
|
|
|
|
|
|
$today = date("Y-m-d 00:00:00"); |
|
|
|
|
|
$LibLeaseRes = $dm->find('bt_library_lease',['library' => '044007','create_time' => ['>=',$today]]); |
|
|
|
|
|
$data = [ |
|
|
|
|
|
'newreader' => 0, |
|
|
|
|
|
'servcount' => 0, |
|
|
|
|
|
'returncount' => 0 |
|
|
|
|
|
]; |
|
|
|
|
|
if ($LibLeaseRes) { |
|
|
|
|
|
$data['newreader'] = $LibLeaseRes['newreader']; # 今日借书册数 |
|
|
|
|
|
$data['servcount'] = $LibLeaseRes['servcount']; # 今日办证人数 |
|
|
|
|
|
$data['returncount'] = $LibLeaseRes['returncount']; # 今日还书册数 |
|
|
|
|
|
} |
|
|
|
|
|
return $data; |
|
|
|
|
|
} |
|
|
} |
|
|
} |