From 5993d4850ecf14f2ac35b755069da670fc6e393d Mon Sep 17 00:00:00 2001 From: nealo <381020974@qq.com> Date: Mon, 5 Oct 2026 11:50:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=A3=E5=8D=95=E7=AD=96=E7=95=A5=E6=95=B0?= =?UTF-8?q?=E7=BB=84=E8=BE=B9=E7=95=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/wms/Wms.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/index/controller/wms/Wms.php b/application/index/controller/wms/Wms.php index f9bb347..ae4640c 100644 --- a/application/index/controller/wms/Wms.php +++ b/application/index/controller/wms/Wms.php @@ -3865,6 +3865,7 @@ class Wms extends Frontend $r["SPACEINDEX"] = 0; } } + unset($r); $calcTime = round((microtime(true) - $stageStart) * 1000, 2); // ========== 优化点3:重构包裹统计 ========== @@ -3891,12 +3892,13 @@ class Wms extends Frontend foreach ($tmporders as &$r) { $r["packindex"] = $packCountMap[$r["PACKID"]] ?? 0; } + unset($r); $packTime = round((microtime(true) - $stageStart) * 1000, 2); // ========== 后续代码保持不变,但速度会提升 ========== $stageStart = microtime(true); usort($tmporders,function($a,$b){ - return ($a['SPACEINDEX'] > $b['SPACEINDEX']); + return $a['SPACEINDEX'] <=> $b['SPACEINDEX']; }); $sort1Time = round((microtime(true) - $stageStart) * 1000, 2); if(count($tmporders)>20){