From 4bdd480e48e0b80b05bb69054257b40ac922d6b6 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 14 Nov 2024 18:11:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(admin):=20=E4=BF=AE=E5=A4=8D=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E5=87=BA=E5=BA=93=E5=8D=95=E6=97=B6=E5=95=86=E5=93=81?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC=E5=92=8C=E6=95=B0=E9=87=8F=E7=9A=84=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 增加了对商品价格的校验,确保所有商品的价格大于 0 - 优化了对商品数量的校验逻辑 --- app/admin/logic/beforehand_order/BeforehandOrderLogic.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 1d32d8356..122531f7e 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -352,6 +352,11 @@ class BeforehandOrderLogic extends BaseLogic throw new BusinessException('该订单已创建出库单'); } $info = BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->select(); + foreach ($info as $k => $v) { + if($v['pay_price']<=0){ + throw new BusinessException('商品价格未空 不能生成出库订单,对应id:'.$v['id']); + } + } $count = BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->where('cart_num', 0)->count('id'); if ($count > 0) { throw new BusinessException('订单中有数量为0的商品,请先处理');