This commit is contained in:
laodaming 2023-09-21 15:57:01 +08:00
parent e87dd4f800
commit 15b278f782

View File

@ -134,11 +134,11 @@ func (l *CalculateCartPriceLogic) CalculateCartPrice(req *types.CalculateCartPri
}) })
updData := &gmodel.FsShoppingCart{ updData := &gmodel.FsShoppingCart{
PurchaseQuantity: &reqPurchaseQuantity, PurchaseQuantity: &reqPurchaseQuantity,
IsSelected: &isSelected,
} }
//如果是选中则累加总价 //如果是选中则累加总价
if isSelected == 1 { if isSelected == 1 {
subTotalPrice += totalPrice subTotalPrice += totalPrice
updData.IsSelected = &isSelected
} }
//更新购物车购买数量 //更新购物车购买数量
if err = shoppingCartModel.Update(l.ctx, cart.Id, userinfo.UserId, updData); err != nil { if err = shoppingCartModel.Update(l.ctx, cart.Id, userinfo.UserId, updData); err != nil {