From 2103e5a723354dec8e47ccd869e7692773f56fbe Mon Sep 17 00:00:00 2001 From: lwl0608 Date: Thu, 1 Aug 2024 14:04:27 +0800 Subject: [PATCH] ignore pay refund --- api/proto/vas/proto/op.go | 5 ++-- app/mix/service/logic/vas.go | 49 ++++++++++++++++++++++-------------- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/api/proto/vas/proto/op.go b/api/proto/vas/proto/op.go index 2b27fb56..1013383a 100644 --- a/api/proto/vas/proto/op.go +++ b/api/proto/vas/proto/op.go @@ -54,8 +54,9 @@ type DealOneOrderReq struct { } type RefundOrderReq struct { - OrderId string `json:"order_id"` - Operator string `json:"operator"` + OrderId string `json:"order_id"` + Operator string `json:"operator"` + IgnorePayRefund bool `json:"ignore_pay_refund"` } type RefundOrderData struct { diff --git a/app/mix/service/logic/vas.go b/app/mix/service/logic/vas.go index 7d6feb01..c0866923 100644 --- a/app/mix/service/logic/vas.go +++ b/app/mix/service/logic/vas.go @@ -2706,9 +2706,11 @@ func (v *Vas) refundMembership(ctx *gin.Context, order *dbstruct.Order, req *vas } // 退款 - err = v.payRefund(ctx, tx, order) - if err != nil { - return err + if !req.IgnorePayRefund { + err = v.payRefund(ctx, tx, order) + if err != nil { + return err + } } return nil @@ -2804,9 +2806,11 @@ func (v *Vas) refundCoins(ctx *gin.Context, order *dbstruct.Order, req *vasproto } // 退款 - err = v.payRefund(ctx, tx, order) - if err != nil { - return err + if !req.IgnorePayRefund { + err = v.payRefund(ctx, tx, order) + if err != nil { + return err + } } return nil @@ -2902,9 +2906,11 @@ func (v *Vas) refundMoneyContactWechat(ctx *gin.Context, order *dbstruct.Order, } // 退款 - err = v.payRefund(ctx, tx, order) - if err != nil { - return err + if !req.IgnorePayRefund { + err = v.payRefund(ctx, tx, order) + if err != nil { + return err + } } return nil @@ -3128,9 +3134,11 @@ func (v *Vas) refundZoneAdmission(ctx *gin.Context, order *dbstruct.Order, req * } // 退款 - err = v.payRefund(ctx, tx, order) - if err != nil { - return err + if !req.IgnorePayRefund { + err = v.payRefund(ctx, tx, order) + if err != nil { + return err + } } return nil @@ -3355,11 +3363,12 @@ func (v *Vas) refundZoneMoment(ctx *gin.Context, order *dbstruct.Order, req *vas } // 退款 - err = v.payRefund(ctx, tx, order) - if err != nil { - return err + if !req.IgnorePayRefund { + err = v.payRefund(ctx, tx, order) + if err != nil { + return err + } } - // 减购买人数 _ = v.store.DecZoneMomentBuyerCnt(ctx, zid, momentId) @@ -3591,9 +3600,11 @@ func (v *Vas) refundZoneSuperfanship(ctx *gin.Context, order *dbstruct.Order, re } // 退款 - err = v.payRefund(ctx, tx, order) - if err != nil { - return err + if !req.IgnorePayRefund { + err = v.payRefund(ctx, tx, order) + if err != nil { + return err + } } return nil