This commit is contained in:
laodaming 2023-10-08 18:07:34 +08:00
parent 8d4901cdcd
commit 6bd9a0ab05

View File

@ -82,13 +82,11 @@ func (l *GetProductStepPriceLogic) GetProductStepPrice(req *types.GetProductStep
mapRsp := make(map[string]interface{}) mapRsp := make(map[string]interface{})
for _, modelInfo := range modelPriceList { for _, modelInfo := range modelPriceList {
var stepPrice gmodel.StepPriceJsonStruct var stepPrice gmodel.StepPriceJsonStruct
if err = json.Unmarshal(*modelInfo.StepPrice, &stepPrice); err != nil { if modelInfo.StepPrice != nil {
logx.Error(err) if err = json.Unmarshal(*modelInfo.StepPrice, &stepPrice); err != nil {
return resp.SetStatusWithMessage(basic.CodeJsonErr, "failed to parse step price json") logx.Error(err)
} return resp.SetStatusWithMessage(basic.CodeJsonErr, "failed to parse step price json")
rangeLen := len(stepPrice.PriceRange) }
if rangeLen == 0 {
return resp.SetStatusWithMessage(basic.CodeServiceErr, fmt.Sprintf("step price is not set:%d", modelInfo.Id))
} }
*modelInfo.PartList = strings.Trim(*modelInfo.PartList, ",") *modelInfo.PartList = strings.Trim(*modelInfo.PartList, ",")
mapFittingUnit := make(map[string]interface{}) mapFittingUnit := make(map[string]interface{})