Browse Source

库存

master
weigang 6 years ago
parent
commit
164b2790b7
  1. 4
      app/Service/v3/Implementations/GoodsActivityService.php
  2. 4
      app/Service/v3/Implementations/GoodsService.php

4
app/Service/v3/Implementations/GoodsActivityService.php

@ -49,8 +49,8 @@ class GoodsActivityService implements GoodsActivityServiceInterface
// 商品库存不足
// 获取冻结的库存
//$inventoryFrozen = (int)$redis->get($inventoryKey);
$inventoryFrozen = 0;
$inventoryFrozen = (int)$redis->get($inventoryKey);
// $inventoryFrozen = 0;
if($goods->is_infinite != 1 && $goods->inventory < ($num+$inventoryFrozen)){
return ErrorCode::GOODS_ACTIVITY_INVENTORY_ERROR;
}

4
app/Service/v3/Implementations/GoodsService.php

@ -40,8 +40,8 @@ class GoodsService implements GoodsServiceInterface
}
// 商品库存不足
// 获取冻结的库存
//$inventoryFrozen = (int)$redis->get($inventoryKey);
$inventoryFrozen = 0;
$inventoryFrozen = (int)$redis->get($inventoryKey);
// $inventoryFrozen = 0;
if($goods->is_infinite != 1 && $goods->inventory < ($num+$inventoryFrozen)){
return ErrorCode::GOODS_INVENTORY_ERROR;
}

Loading…
Cancel
Save