This commit is contained in:
laodaming
2023-09-26 16:40:13 +08:00
2 changed files with 6 additions and 3 deletions

View File

@@ -844,11 +844,14 @@ func (d *defaultOrder) Create(ctx context.Context, in *CreateReq) (res *CreateRe
var stepPriceJson gmodel.StepPriceJsonStruct
if shoppingCartProductModel3d.StepPrice != nil && len(*shoppingCartProductModel3d.StepPrice) != 0 {
json.Unmarshal(*shoppingCartProductModel3d.StepPrice, &shoppingCartProductModel3d.StepPrice)
err = json.Unmarshal(*shoppingCartProductModel3d.StepPrice, &shoppingCartProductModel3d.StepPrice)
if err != nil {
return err
}
} else {
errorCode = *basic.CodeErrOrderCreatProductPriceAbsent
errorCode.Message = "create order failed, step price of product '" + shoppingCartSnapshot.ProductInfo.ProductName + "'is failed"
return err
return errors.New("shoppingCartProductModel3d.StepPrice nil")
}
/* 计算价格 */