From 12085dca8fd21577249ec70f568464aa62161487 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Tue, 19 Sep 2023 13:56:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=B4=AD=E7=89=A9=E8=BD=A6=E4=B8=8B?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- constants/orders.go | 16 ++++++++++++++++ model/gmodel/fs_order_logic.go | 9 +++++---- service/repositories/order.go | 2 ++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/constants/orders.go b/constants/orders.go index c2bc07b2..6696f18e 100644 --- a/constants/orders.go +++ b/constants/orders.go @@ -30,6 +30,22 @@ const ( PayStatusRefunded PayStatusCode = 30 //30,已退款 ) +// 订单支付状态 +type OrderPayStatusCode int64 + +// 0,未付首款 +// 10,已付首款 +// 20,已退首款 +// 30,已付尾款 +// 40,已退尾款 +const ( + OrderPayStatusUnpaidDEPOSIT OrderPayStatusCode = 0 + OrderPayStatusPaidDEPOSIT OrderPayStatusCode = 10 + OrderPayStatusRefundedDEPOSIT OrderPayStatusCode = 20 + OrderPayStatusPaidDREMAINING OrderPayStatusCode = 30 + OrderPayStatusRefundedREMAINING OrderPayStatusCode = 40 +) + // 订单状态 type OrderStatusCode int64 diff --git a/model/gmodel/fs_order_logic.go b/model/gmodel/fs_order_logic.go index 5cad94b5..ec871747 100644 --- a/model/gmodel/fs_order_logic.go +++ b/model/gmodel/fs_order_logic.go @@ -22,10 +22,11 @@ type NewFsOrder struct { // 订单详情 type OrderDetail struct { - DeliveryAddress *OrderAddress `json:"delivery_address"` // 收货地址 - OrderAmount OrderAmount `json:"order_amount"` // 订单金额 - OrderInfo OrderInfo `json:"order_info"` // 订单信息 - OrderProduct []OrderProduct `json:"order_product"` // 订单商品 + DeliveryAddress *OrderAddress `json:"delivery_address"` // 收货地址 + OrderAmount OrderAmount `json:"order_amount"` // 订单金额 + OrderInfo OrderInfo `json:"order_info"` // 订单信息 + OrderProduct []OrderProduct `json:"order_product"` // 订单商品 + PayStatus constants.OrderPayStatusCode `json:"pay_status"` // 支付状态 } // 收货地址 diff --git a/service/repositories/order.go b/service/repositories/order.go index 8a22f5c5..d9d3f10a 100644 --- a/service/repositories/order.go +++ b/service/repositories/order.go @@ -99,6 +99,8 @@ func (d *defaultOrder) Create(ctx context.Context, in *CreateReq) (res *CreateRe // 订单总价(厘) var orderTotal int64 + var payStatus int64 + for _, shoppingCart := range shoppingCartList { // 购物车快照 var shoppingCartSnapshot shopping_cart.CartSnapshot