开启库存校验库存数量

This commit is contained in:
SongZhang 2024-10-24 14:12:40 +08:00
parent 62a931145b
commit 743f59d4a3
1 changed files with 1 additions and 1 deletions

View File

@ -443,7 +443,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
throw new BadRequestException("商品不存在或已下架, id: " + addCartDTO.getSkuId());
}
if (product.getStockNumber() < 1) {
if (product.getIsStock() != null && product.getIsStock() == 1 &&product.getStockNumber() < 1) {
throw new BadRequestException(product.getName() + "商品库存不足");
}