调整活动商品库存限制

This commit is contained in:
luofei 2024-01-24 18:45:12 +08:00
parent 1617d0ede6
commit 24f74b4fd5

View File

@ -116,7 +116,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
} }
} }
$oldProductId = $cart->product->old_product_id ?? 0; $oldProductId = $cart->product->old_product_id ?? 0;
if (in_array($oldProductId, [1, 2, 3])) { if (in_array($oldProductId, [172289, 11968, 11933, 11827])) {
$oldProductStock = Db::name('store_product')->where('product_id', $oldProductId)->value('stock'); $oldProductStock = Db::name('store_product')->where('product_id', $oldProductId)->value('stock');
if ($oldProductStock < $cart['cart_num']) { if ($oldProductStock < $cart['cart_num']) {
throw new ValidateException('商品库存不足'); throw new ValidateException('商品库存不足');