From 664f07a75a7faa3a60a3fd89adc59bb35f82d15f Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Wed, 9 Aug 2023 19:06:48 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=88=E5=80=BC=E8=AE=A1=E7=AE=97=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/application/common/logic/PassFlow.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/application/common/logic/PassFlow.php b/source/application/common/logic/PassFlow.php index 351f6fc..e29a417 100644 --- a/source/application/common/logic/PassFlow.php +++ b/source/application/common/logic/PassFlow.php @@ -349,12 +349,14 @@ class PassFlow foreach ($list as $value) { if (!isset($data[$value['groupId']]['allEnter'])) $data[$value['groupId']]['allEnter'] = 0; $data[$value['groupId']]['allEnter'] += $value['allEnter']; + if (!isset($data[$value['groupId']]['holdValue'])) $data[$value['groupId']]['holdValue'] = 0; + $data[$value['groupId']]['holdValue'] += $value['holdValue']; } $groupThreshold = self::$groupThreshold; $returnData = []; foreach ($data as $groupId => $val) { - $proportion = $val['holdValue'] > 0 ? round($val['holdValue']/$groupThreshold[$val['groupId']],4) : 0; + $proportion = $val['holdValue'] > 0 ? round($val['holdValue']/$groupThreshold[$groupId],4) : 0; $val['proportion'] = ($proportion * 100) . "%"; $val['congestion'] = self::getPassType($proportion); $val['groupId'] = $groupId;