fix
This commit is contained in:
parent
3aceed8200
commit
e87dd4f800
@ -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 {
|
if err != nil {
|
||||||
logx.Error(err)
|
logx.Error(err)
|
||||||
return resp.SetStatusWithMessage(basic.CodeServiceErr, err.Error())
|
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
|
sizeCapacity := snapShot.SizeInfo.Capacity
|
||||||
if sizeInfo, ok := mapSize[*cart.SizeId]; ok {
|
if sizeInfo, ok := mapSize[*cart.SizeId]; ok {
|
||||||
@ -191,7 +183,8 @@ func (l *GetCartsLogic) GetCarts(req *types.GetCartsReq, userinfo *auth.UserInfo
|
|||||||
Slogan: snapShot.UserDiyInformation.Slogan,
|
Slogan: snapShot.UserDiyInformation.Slogan,
|
||||||
},
|
},
|
||||||
PurchaseQuantity: *cart.PurchaseQuantity,
|
PurchaseQuantity: *cart.PurchaseQuantity,
|
||||||
StepNum: stepQuantityList,
|
MinPurchaseQuantity: *sizePrice.EachBoxNum * (*sizePrice.MinBuyNum),
|
||||||
|
StepPurchaseQuantity: *sizePrice.EachBoxNum,
|
||||||
IsInvalid: false,
|
IsInvalid: false,
|
||||||
InvalidDescription: "",
|
InvalidDescription: "",
|
||||||
IsHighlyCustomized: *cart.IsHighlyCustomized > 0,
|
IsHighlyCustomized: *cart.IsHighlyCustomized > 0,
|
||||||
|
@ -46,8 +46,9 @@ type CartItem struct {
|
|||||||
ItemPrice string `json:"item_price"` //单价
|
ItemPrice string `json:"item_price"` //单价
|
||||||
TotalPrice string `json:"total_price"` //单价X数量=总价
|
TotalPrice string `json:"total_price"` //单价X数量=总价
|
||||||
DiyInformation DiyInformation `json:"diy_information"` //diy信息
|
DiyInformation DiyInformation `json:"diy_information"` //diy信息
|
||||||
StepNum []int64 `json:"step_num"` //阶梯数量
|
|
||||||
PurchaseQuantity int64 `json:"purchase_quantity"` //当前购买数量
|
PurchaseQuantity int64 `json:"purchase_quantity"` //当前购买数量
|
||||||
|
MinPurchaseQuantity int64 `json:"min_purchase_quantity"` //起购数量
|
||||||
|
StepPurchaseQuantity int64 `json:"step_purchase_quantity"` //购买加或者减少步进量
|
||||||
IsHighlyCustomized bool `json:"is_highly_customized"` //是否高度定制
|
IsHighlyCustomized bool `json:"is_highly_customized"` //是否高度定制
|
||||||
IsInvalid bool `json:"is_invalid"` //是否无效
|
IsInvalid bool `json:"is_invalid"` //是否无效
|
||||||
InvalidDescription string `json:"invalid_description"` //无效原因
|
InvalidDescription string `json:"invalid_description"` //无效原因
|
||||||
|
@ -63,8 +63,9 @@ type CartItem {
|
|||||||
ItemPrice string `json:"item_price"` //单价
|
ItemPrice string `json:"item_price"` //单价
|
||||||
TotalPrice string `json:"total_price"` //单价X数量=总价
|
TotalPrice string `json:"total_price"` //单价X数量=总价
|
||||||
DiyInformation DiyInformation `json:"diy_information"` //diy信息
|
DiyInformation DiyInformation `json:"diy_information"` //diy信息
|
||||||
StepNum []int64 `json:"step_num"` //阶梯数量
|
|
||||||
PurchaseQuantity int64 `json:"purchase_quantity"` //当前购买数量
|
PurchaseQuantity int64 `json:"purchase_quantity"` //当前购买数量
|
||||||
|
MinPurchaseQuantity int64 `json:"min_purchase_quantity"` //起购数量
|
||||||
|
StepPurchaseQuantity int64 `json:"step_purchase_quantity"` //购买加或者减少步进量
|
||||||
IsHighlyCustomized bool `json:"is_highly_customized"` //是否高度定制
|
IsHighlyCustomized bool `json:"is_highly_customized"` //是否高度定制
|
||||||
IsInvalid bool `json:"is_invalid"` //是否无效
|
IsInvalid bool `json:"is_invalid"` //是否无效
|
||||||
InvalidDescription string `json:"invalid_description"` //无效原因
|
InvalidDescription string `json:"invalid_description"` //无效原因
|
||||||
|
Loading…
x
Reference in New Issue
Block a user