Browse Source

阈值计算优化

master
wanghongjun 3 years ago
parent
commit
664f07a75a
  1. 4
      source/application/common/logic/PassFlow.php

4
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;

Loading…
Cancel
Save