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 {