From 8d9ff4fe1014b8e4376a09a9150465b15c4992ea Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Wed, 27 Sep 2023 17:51:25 +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 --- constants/orders.go | 11 +++++++++++ service/repositories/order.go | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/constants/orders.go b/constants/orders.go index e67c9583..230df8e1 100644 --- a/constants/orders.go +++ b/constants/orders.go @@ -79,6 +79,9 @@ var OrderStatusMessage map[OrderStatusCode]string // 支付状态名称 var PayStatusMessage map[PayStatusCode]string +// 支付状态名称 +var OrderPayStatusMessage map[OrderPayStatusCode]string + // 订单状态--用户可见--直邮 var OrderStatusUserDIRECTMAIL []OrderStatusCode @@ -86,6 +89,14 @@ var OrderStatusUserDIRECTMAIL []OrderStatusCode var OrderStatusUserCLOUDSTORE []OrderStatusCode func init() { + // 订单状态名称 + OrderPayStatusMessage = make(map[OrderPayStatusCode]string) + OrderPayStatusMessage[ORDER_PAY_STATUS_UNPAIDDEPOSIT] = "未付首款" + OrderPayStatusMessage[ORDER_PAY_STATUS_PAIDDEPOSIT] = "已付首款" + OrderPayStatusMessage[ORDER_PAY_STATUS_REFUNDEDDEPOSIT] = "已退首款" + OrderPayStatusMessage[ORDER_PAY_STATUS_PAIDDREMAINING] = "已付尾款" + OrderPayStatusMessage[ORDER_PAY_STATUS_REFUNDEDREMAINING] = "已退尾款" + // 订单状态名称 PayStatusMessage = make(map[PayStatusCode]string) PayStatusMessage[PAY_STATUS_UNPAID] = "Unpaid" diff --git a/service/repositories/order.go b/service/repositories/order.go index 5f3aed5f..04713fad 100644 --- a/service/repositories/order.go +++ b/service/repositories/order.go @@ -331,7 +331,10 @@ func (d *defaultOrder) PaymentSuccessful(ctx context.Context, in *PaymentSuccess orderAmount["remaining_balance"] = payInfo } - payStatusLink = append(ress.OrderDetailOriginal.PayStatusLink, payInfo.Status) + payStatusLink = append(ress.OrderDetailOriginal.PayStatusLink, gmodel.PayStatus{ + StatusCode: int64(orderPayStatusCode), + StatusTitle: constants.OrderPayStatusMessage[orderPayStatusCode], + }) orderAmountByte, err := json.Marshal(orderAmount) if err != nil {