fix
This commit is contained in:
@@ -98,8 +98,11 @@ func (l *CalculateCartPriceLogic) CalculateCartPrice(req *types.CalculateCartPri
|
||||
return err
|
||||
}
|
||||
var stepPrice gmodel.StepPriceJsonStruct
|
||||
if err = json.Unmarshal(*modelInfo.StepPrice, &stepPrice); err != nil {
|
||||
return err
|
||||
if modelInfo.StepPrice != nil && len(*modelInfo.StepPrice) != 0 {
|
||||
if err = json.Unmarshal(*modelInfo.StepPrice, &stepPrice); err != nil {
|
||||
logx.Error(err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
//请求的数量
|
||||
reqPurchaseQuantity := mapCalculateQuantity[cart.Id].PurchaseQuantity
|
||||
|
||||
@@ -104,9 +104,11 @@ func (l *GetCartsLogic) GetCarts(req *types.GetCartsReq, userinfo *auth.UserInfo
|
||||
return resp.SetStatusWithMessage(basic.CodeServiceErr, fmt.Sprintf("the size`s model info is not exists:%d_%d", *cart.ProductId, *cart.SizeId))
|
||||
}
|
||||
var stepPrice gmodel.StepPriceJsonStruct
|
||||
if err = json.Unmarshal(*modelInfo.StepPrice, &stepPrice); err != nil {
|
||||
logx.Error(err)
|
||||
return resp.SetStatusWithMessage(basic.CodeJsonErr, fmt.Sprintf("failed to parse model step price:%d", *cart.ModelId))
|
||||
if modelInfo.StepPrice != nil && len(*modelInfo.StepPrice) != 0 {
|
||||
if err = json.Unmarshal(*modelInfo.StepPrice, &stepPrice); err != nil {
|
||||
logx.Error(err)
|
||||
return resp.SetStatusWithMessage(basic.CodeJsonErr, fmt.Sprintf("failed to parse model step price:%d", *cart.ModelId))
|
||||
}
|
||||
}
|
||||
//购买数量步进量
|
||||
stepPurchaseQuantity := *modelInfo.PackedUnit
|
||||
|
||||
Reference in New Issue
Block a user