fix
This commit is contained in:
@@ -123,19 +123,11 @@ func (l *GetCartsLogic) GetCarts(req *types.GetCartsReq, userinfo *auth.UserInfo
|
||||
}
|
||||
}
|
||||
//计算价格
|
||||
itemPrice, totalPrice, stepNum, _, err := l.svcCtx.Repositories.NewShoppingCart.CaculateCartPrice(*cart.PurchaseQuantity, &sizePrice, fittingPrice)
|
||||
itemPrice, totalPrice, _, _, err := l.svcCtx.Repositories.NewShoppingCart.CaculateCartPrice(*cart.PurchaseQuantity, &sizePrice, fittingPrice)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return resp.SetStatusWithMessage(basic.CodeServiceErr, err.Error())
|
||||
}
|
||||
//获取阶梯数量
|
||||
stepQuantityList := make([]int64, 0, 20)
|
||||
tmpMinBuyNum := *sizePrice.MinBuyNum
|
||||
for tmpMinBuyNum < (int64(stepNum[len(stepNum)-1]) + 5) {
|
||||
tmpQuantity := tmpMinBuyNum * (*sizePrice.EachBoxNum)
|
||||
stepQuantityList = append(stepQuantityList, tmpQuantity)
|
||||
tmpMinBuyNum++
|
||||
}
|
||||
//尺寸信息
|
||||
sizeCapacity := snapShot.SizeInfo.Capacity
|
||||
if sizeInfo, ok := mapSize[*cart.SizeId]; ok {
|
||||
@@ -190,12 +182,13 @@ func (l *GetCartsLogic) GetCarts(req *types.GetCartsReq, userinfo *auth.UserInfo
|
||||
Qrcode: snapShot.UserDiyInformation.Qrcode,
|
||||
Slogan: snapShot.UserDiyInformation.Slogan,
|
||||
},
|
||||
PurchaseQuantity: *cart.PurchaseQuantity,
|
||||
StepNum: stepQuantityList,
|
||||
IsInvalid: false,
|
||||
InvalidDescription: "",
|
||||
IsHighlyCustomized: *cart.IsHighlyCustomized > 0,
|
||||
IsSelected: *cart.IsSelected > 0,
|
||||
PurchaseQuantity: *cart.PurchaseQuantity,
|
||||
MinPurchaseQuantity: *sizePrice.EachBoxNum * (*sizePrice.MinBuyNum),
|
||||
StepPurchaseQuantity: *sizePrice.EachBoxNum,
|
||||
IsInvalid: false,
|
||||
InvalidDescription: "",
|
||||
IsHighlyCustomized: *cart.IsHighlyCustomized > 0,
|
||||
IsSelected: *cart.IsSelected > 0,
|
||||
}
|
||||
//是否有失效的
|
||||
if description, ok := mapCartChange[cart.Id]; ok {
|
||||
|
||||
Reference in New Issue
Block a user