From 351f18b9839a70df41bc50b5ca408521f01dafa3 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Tue, 7 Nov 2023 16:14:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E5=8C=96=E9=A6=86=E5=B9=B4=E5=BA=A6?= =?UTF-8?q?=E6=80=BB=E6=95=B0=E6=8D=AE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/application/common/logic/PassFlow.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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;