fix
This commit is contained in:
parent
d6a25673bc
commit
e999672037
|
@ -116,7 +116,7 @@ func (l *CalculateCartPriceLogic) CalculateCartPrice(req *types.CalculateCartPri
|
|||
if fittingInfo, ok := mapModel[*cart.FittingId]; ok {
|
||||
fittingPrice = *fittingInfo.Price
|
||||
} else {
|
||||
return errors.New(fmt.Sprintf("cart contain some one witch lose fitting:%d", *cart.FittingId))
|
||||
logx.Error(fmt.Sprintf("cart contain some one witch lose fitting:%d", *cart.FittingId))
|
||||
}
|
||||
}
|
||||
//计算价格
|
||||
|
|
|
@ -116,14 +116,14 @@ func (l *GetCartsLogic) GetCarts(req *types.GetCartsReq, userinfo *auth.UserInfo
|
|||
fittingPrice := int64(0)
|
||||
if *cart.FittingId > 0 {
|
||||
curFittingInfo, ok := mapModel[*cart.FittingId]
|
||||
if !ok {
|
||||
return resp.SetStatusWithMessage(basic.CodeServiceErr, fmt.Sprintf("cart contain some one witch lose fitting:%d", *cart.FittingId))
|
||||
}
|
||||
fittingPrice = *curFittingInfo.Price
|
||||
//取大的为步进量基数
|
||||
if *curFittingInfo.PackedUnit > stepPurchaseQuantity {
|
||||
stepPurchaseQuantity = *curFittingInfo.PackedUnit
|
||||
if ok {
|
||||
fittingPrice = *curFittingInfo.Price
|
||||
//取大的为步进量基数
|
||||
if *curFittingInfo.PackedUnit > stepPurchaseQuantity {
|
||||
stepPurchaseQuantity = *curFittingInfo.PackedUnit
|
||||
}
|
||||
}
|
||||
logx.Error(fmt.Sprintf("cart contain some one witch lose fitting:%d", *cart.FittingId))
|
||||
}
|
||||
//计算阶梯价格
|
||||
totalPrice, itemPrice, err := l.svcCtx.Repositories.NewShoppingCart.CaculateStepPrice(*cart.PurchaseQuantity, stepPrice, fittingPrice)
|
||||
|
|
Loading…
Reference in New Issue
Block a user