From 6e9f47ff856398c7111ad485cc7f68f96778ff32 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Tue, 26 Sep 2023 16:30:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/repositories/order.go | 7 +++++-- utils/basic/basic.go | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/service/repositories/order.go b/service/repositories/order.go index bb03aaca..70882116 100644 --- a/service/repositories/order.go +++ b/service/repositories/order.go @@ -844,11 +844,14 @@ func (d *defaultOrder) Create(ctx context.Context, in *CreateReq) (res *CreateRe var stepPriceJson gmodel.StepPriceJsonStruct if shoppingCartProductModel3d.StepPrice != nil { - 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") } /* 计算价格 */ diff --git a/utils/basic/basic.go b/utils/basic/basic.go index b3ecd3a7..73222e45 100644 --- a/utils/basic/basic.go +++ b/utils/basic/basic.go @@ -107,7 +107,7 @@ var ( CodeErrOrderCreatProductPriceAbsent = &StatusResponse{5304, "create order failed, price of product is absent"} // 订单创建失败,商品价格不存在 CodeErrOrderCreatProductAccessoryAbsent = &StatusResponse{5305, "create order failed, accessory of product is absent"} // 订单创建失败,商品配件不存在 CodeErrOrderCreatePrePaymentParam = &StatusResponse{5306, "create payment failed, the shipping address is illegal"} // 订单创建失败,商品配件不存在 - CodeErrOrderCreatePrePaymentInfoNoFound = &StatusResponse{5307, "create payment failed, order info not found"} + CodeErrOrderCreatePrePaymentInfoNoFound = &StatusResponse{5307, "order info not found"} CodeErrOrderCreatePrePaymentNoUnPaid = &StatusResponse{5308, "create payment failed, order is not unpaid"} CodeErrOrderCreatePrePaymentPaid = &StatusResponse{5309, "create payment failed, order is paid"} CodeErrOrderCreatePrePaymentTimeout = &StatusResponse{5310, "create payment failed, timeout"}