From 1064aa0cd60feea4b55309a371779eec3a5e9de5 Mon Sep 17 00:00:00 2001 From: travis <310243791@qq.com> Date: Tue, 10 Dec 2019 19:58:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=95=86=E5=93=81=E5=8F=91=E8=B4=A7?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/modules/shop/logic/delivery/DeliveryManager.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/modules/shop/logic/delivery/DeliveryManager.php b/backend/modules/shop/logic/delivery/DeliveryManager.php index 61cd417..cbb4ff9 100644 --- a/backend/modules/shop/logic/delivery/DeliveryManager.php +++ b/backend/modules/shop/logic/delivery/DeliveryManager.php @@ -69,6 +69,11 @@ class DeliveryManager { $status = Order::STATUS_SHIPMENT_ALL; foreach ($deliveryGoods as $id => $goodsCount) { + if ($goodsCount <= 0) { + throw new Exception('操作异常,发货数量不能小于0'); + } elseif ($goodsCount == 0) { + continue; + } $orderGoods = OrderGoods::findOne($id); /*如果是发货数量不是全部,订单状态为部分发货*/