order-pre
parent
d0376a1f00
commit
ca9b805cb6
|
|
@ -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('商品库存不足');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue