fix
This commit is contained in:
@@ -169,8 +169,14 @@ func (l *GetCartsLogic) GetCarts(req *types.GetCartsReq, userinfo *auth.UserInfo
|
||||
tmpMinBuyNum++
|
||||
}
|
||||
//根据数量获取阶梯价格中对应的价格
|
||||
itemPrice := step_price.GetStepPrice(boxQuantity, stepNum, stepPrice)
|
||||
totalPrice := itemPrice * float64(*cart.PurchaseQuantity)
|
||||
itemPrice := step_price.GetCentStepPrice(boxQuantity, stepNum, stepPrice)
|
||||
//如果有配件,单价也要加入配件价格
|
||||
if *cart.FittingId > 0 {
|
||||
if curFittingInfo, ok := mapModel[*cart.FittingId]; ok {
|
||||
itemPrice += *curFittingInfo.Price
|
||||
}
|
||||
}
|
||||
totalPrice := itemPrice * (*cart.PurchaseQuantity)
|
||||
item := types.CartItem{
|
||||
ProductId: *cart.ProductId,
|
||||
SizeInfo: types.SizeInfo{
|
||||
@@ -185,8 +191,8 @@ func (l *GetCartsLogic) GetCarts(req *types.GetCartsReq, userinfo *auth.UserInfo
|
||||
FittingId: *cart.FittingId,
|
||||
FittingName: snapShot.FittingInfo.FittingName,
|
||||
},
|
||||
ItemPrice: fmt.Sprintf("%.3f", itemPrice),
|
||||
TotalPrice: fmt.Sprintf("%.3f", totalPrice),
|
||||
ItemPrice: fmt.Sprintf("%.3f", format.CentitoDollar(itemPrice)),
|
||||
TotalPrice: fmt.Sprintf("%.3f", format.CentitoDollar(totalPrice)),
|
||||
DiyInformation: types.DiyInformation{
|
||||
Phone: snapShot.UserDiyInformation.Phone,
|
||||
Address: snapShot.UserDiyInformation.Address,
|
||||
|
||||
Reference in New Issue
Block a user