fix: 加入购物车skuid可选

This commit is contained in:
张松
2024-12-04 14:37:47 +08:00
parent 56d1fbad0c
commit f95d53611c

View File

@@ -386,7 +386,7 @@ public class CartService {
return Result.fail("该商品不存在");
}
// 判断商品是否已下架
tbProductSkuWithBLOBs = productSkuMapper.selectByPrimaryKey(Integer.valueOf(skuId));
tbProductSkuWithBLOBs = StrUtil.isBlank(skuId) ? null: productSkuMapper.selectByPrimaryKey(Integer.valueOf(skuId));
if (tbProductSkuWithBLOBs == null || tbProductSkuWithBLOBs.getIsGrounding().equals(0)) {
rmCart(jsonObject, skuId, tableCartKey);
return Result.fail("商品已下架");