This commit is contained in:
laodaming 2023-10-17 17:25:34 +08:00
parent bfe0ee0652
commit 68cf3a10d6

View File

@ -278,12 +278,11 @@ func (l *GetProductDetailLogic) GetModelOptionalFittings(ctx context.Context, op
}
fittingInfo := modelList[fittingIndex]
var fittingDesignInfo interface{}
if fittingInfo.ModelInfo == nil || *fittingInfo.ModelInfo == "" {
continue
}
if err = json.Unmarshal([]byte(*fittingInfo.ModelInfo), &fittingDesignInfo); err != nil {
logx.Error(err)
return nil, errors.New("failed to parse fitting design info")
if fittingInfo.ModelInfo != nil && *fittingInfo.ModelInfo != "" {
if err = json.Unmarshal([]byte(*fittingInfo.ModelInfo), &fittingDesignInfo); err != nil {
logx.Error(err)
return nil, errors.New("failed to parse fitting design info")
}
}
//是否默认显示配件
isDefault := int64(0)