diff --git a/app/Services/OrderService.php b/app/Services/OrderService.php index 5230bc1b..e01712e0 100644 --- a/app/Services/OrderService.php +++ b/app/Services/OrderService.php @@ -110,11 +110,13 @@ class OrderService ?string $note = null, ?BargainOrder $bargainOrder = null, ): Order { - foreach ($products as $product) { - $sku = $product['sku']; - - if ($product['quantity'] > $sku->saleable_stock) { - throw new BizException('商品库存不足'); + if ($shippingAddressId) { + foreach ($products as $product) { + $sku = $product['sku']; + + if ($product['quantity'] > $sku->saleable_stock) { + throw new BizException('商品库存不足'); + } } }