order-pre
parent
d0376a1f00
commit
ca9b805cb6
|
|
@ -110,11 +110,13 @@ class OrderService
|
||||||
?string $note = null,
|
?string $note = null,
|
||||||
?BargainOrder $bargainOrder = null,
|
?BargainOrder $bargainOrder = null,
|
||||||
): Order {
|
): Order {
|
||||||
foreach ($products as $product) {
|
if ($shippingAddressId) {
|
||||||
$sku = $product['sku'];
|
foreach ($products as $product) {
|
||||||
|
$sku = $product['sku'];
|
||||||
if ($product['quantity'] > $sku->saleable_stock) {
|
|
||||||
throw new BizException('商品库存不足');
|
if ($product['quantity'] > $sku->saleable_stock) {
|
||||||
|
throw new BizException('商品库存不足');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue