diff --git a/source/application/common/logic/PassFlow.php b/source/application/common/logic/PassFlow.php index b416cb5..ac3d61c 100644 --- a/source/application/common/logic/PassFlow.php +++ b/source/application/common/logic/PassFlow.php @@ -526,6 +526,16 @@ class PassFlow 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 @@ -542,7 +552,7 @@ class PassFlow $ts_res = $dm->find('bt_library',['group_id' => 'baz001']); $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_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']; @@ -563,7 +573,7 @@ class PassFlow $wh_res = $dm->find('bt_library',['group_id' => 'BAF055']); $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_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;