6
0
Fork 0

order-pre

release
panliang 2022-05-18 14:48:05 +08:00
parent d0376a1f00
commit ca9b805cb6
1 changed files with 7 additions and 5 deletions

View File

@ -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('商品库存不足');
}
}
}