feat: 购物车新增相同商品只会改变数量

This commit is contained in:
wst 2024-12-07 09:48:31 +08:00
parent 5f9968df83
commit 963e13d4e5

View file

@ -118,7 +118,7 @@ public class ShopTradeCartServiceImpl extends SkyeyeBusinessServiceImpl<ShopTrad
QueryWrapper<ShopTradeCart> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(MybatisPlusUtil.toColumns(ShopTradeCart::getMaterialId), shopTradeCart.getMaterialId());
queryWrapper.eq(MybatisPlusUtil.toColumns(ShopTradeCart::getNormsId), shopTradeCart.getNormsId());
queryWrapper.eq(CommonConstants.ID,userId);
queryWrapper.eq(MybatisPlusUtil.toColumns(ShopTradeCart::getCreateId),userId);
ShopTradeCart one = getOne(queryWrapper);
if (ObjectUtil.isNotEmpty(one)) {
shopTradeCart.setId(one.getId());