Browse Source

文化馆年度总数据优化

master
wanghongjun 2 years ago
parent
commit
351f18b983
  1. 14
      source/application/common/logic/PassFlow.php

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

@ -526,6 +526,16 @@ class PassFlow
return $data; return $data;
} }
protected static function getWhYearData($dm,$group_id)
{
$start = date("Y-01-01 ") ."00:00:00";
$end = date("Y-12-31 ") ."23:59:59";
$where = ' "date" = ' . "'year'" . ' and "group_id" = ' . "'{$group_id}'"
. ' and "create_time" >= ' . "'{$start}'" . ' and "create_time" <= ' . "'{$end}'";
$libData = $dm->find('bt_library_data',$where,'incount');
return $libData['incount'] ?: 0;
}
/** /**
* 文化-博物-图书-数据接口 总计服务人数 * 文化-博物-图书-数据接口 总计服务人数
* @return array * @return array
@ -542,7 +552,7 @@ class PassFlow
$ts_res = $dm->find('bt_library',['group_id' => 'baz001']); $ts_res = $dm->find('bt_library',['group_id' => 'baz001']);
$ts_today_incount = isset($ts_res['today_incount']) ? $ts_res['today_incount'] : 0; $ts_today_incount = isset($ts_res['today_incount']) ? $ts_res['today_incount'] : 0;
$ts_month_incount = isset($ts_res['month_incount']) ? $ts_res['month_incount'] : 0; $ts_month_incount = isset($ts_res['month_incount']) ? $ts_res['month_incount'] : 0;
$ts_year_incount = isset($ts_res['year_incount']) ? $ts_res['year_incount'] : 0; $ts_year_incount = self::getWhYearData($dm,'baz001');
# 劳务博物馆数据 # 劳务博物馆数据
$dateArr = ['day' => 'daily', 'month' => 'monthly', 'year' => 'yearly']; $dateArr = ['day' => 'daily', 'month' => 'monthly', 'year' => 'yearly'];
@ -563,7 +573,7 @@ class PassFlow
$wh_res = $dm->find('bt_library',['group_id' => 'BAF055']); $wh_res = $dm->find('bt_library',['group_id' => 'BAF055']);
$wh_today_incount = isset($wh_res['today_incount']) ? $wh_res['today_incount'] : 0; $wh_today_incount = isset($wh_res['today_incount']) ? $wh_res['today_incount'] : 0;
$wh_month_incount = isset($wh_res['month_incount']) ? $wh_res['month_incount'] : 0; $wh_month_incount = isset($wh_res['month_incount']) ? $wh_res['month_incount'] : 0;
$wh_year_incount = isset($wh_res['year_incount']) ? $wh_res['year_incount'] : 0; $wh_year_incount = self::getWhYearData($dm,'BAF055');
# 总年、月、日总数 # 总年、月、日总数
$sum_today_incount = $ts_today_incount + $bw_today_incount + $wh_today_incount; $sum_today_incount = $ts_today_incount + $bw_today_incount + $wh_today_incount;

Loading…
Cancel
Save