Browse Source

商品限购处理

master
weigang 6 years ago
parent
commit
fa7f26e6aa
  1. 2
      app/Service/v3/Implementations/GoodsActivityService.php
  2. 5
      app/Service/v3/Implementations/GoodsService.php

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

@ -48,7 +48,7 @@ class GoodsActivityService implements GoodsActivityServiceInterface
}
// 是否超过限购数量
if ($goods->restrict_num < $num) {
if ($goods->restrict_num != 0 && $goods->restrict_num < $num) {
return ErrorCode::GOODS_ACTIVITY_RESTRICT_LIMIT;
}

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

@ -37,6 +37,11 @@ class GoodsService implements GoodsServiceInterface
return ErrorCode::GOODS_INVENTORY_ERROR;
}
// 是否超过限购数量
if ($goods->restrict_num != 0 && $goods->restrict_num < $num) {
return ErrorCode::GOODS_RESTRICT_LIMIT;
}
return true;
}

Loading…
Cancel
Save