From 07b5564e0ef0c4a564d4bfe2d37c872b7cf2c9a9 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 18 Oct 2024 11:43:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(admin):=20=E4=BF=AE=E5=A4=8D=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=8F=90=E4=BA=A4=E6=97=B6=E5=95=86=E5=93=81=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E4=B8=BA=E9=9B=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在创建出库单前增加检查,确保订单中没有数量为 0 的商品 - 如果存在数量为 0 的商品,抛出异常并提示用户处理 --- app/admin/logic/beforehand_order/BeforehandOrderLogic.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index c9d9798cc..ba046d907 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -303,6 +303,10 @@ class BeforehandOrderLogic extends BaseLogic throw new BusinessException('该订单已创建出库单'); } $info = BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->select(); + $count = BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->where('cart_num',0)->count('id'); + if($count > 0){ + throw new BusinessException('订单中有数量为0的商品,请先处理'); + } Db::startTrans(); try { $arr = [