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