From 4e4b603a43d599dcfa75da93e39121bc71ddd20a Mon Sep 17 00:00:00 2001 From: wangxinyu Date: Mon, 9 Dec 2024 10:44:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=82=E6=95=B0=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E5=92=8C=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/consts/consts.go | 5 +++++ app/mix/controller/zone_vas_api.go | 2 +- app/mix/service/logic/vas_zone.go | 9 ++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/api/consts/consts.go b/api/consts/consts.go index 959919ec..23b0754c 100644 --- a/api/consts/consts.go +++ b/api/consts/consts.go @@ -99,6 +99,11 @@ const ( RedisMomentPrefix = "moment:" //moment服务前缀 ) +const ( + Unaudited = 1 // 未审核 + Audited = 2 // 已审核 +) + //const PackageRootPath = "C:/Users/PC/Desktop/service" const PackageRootPath = "/app/wishpal-ironfan" diff --git a/app/mix/controller/zone_vas_api.go b/app/mix/controller/zone_vas_api.go index db085e0f..a1b0939d 100644 --- a/app/mix/controller/zone_vas_api.go +++ b/app/mix/controller/zone_vas_api.go @@ -132,7 +132,7 @@ func ZoneRefundV2(ctx *gin.Context) { func ZoneRefundList(ctx *gin.Context) { req := ctx.MustGet("client_req").(*vasproto.ZoneRefundListReq) - if req.Mid <= 0 { + if req.Mid <= 0 || (req.AuditType != consts.Unaudited && req.AuditType != consts.Audited) { logger.Error("ZoneRefundList, invalid param, req: %v", util.ToJson(req)) ReplyErrCodeMsg(ctx, errcode.ErrCodeBadParam) return diff --git a/app/mix/service/logic/vas_zone.go b/app/mix/service/logic/vas_zone.go index c5813972..7520aa0c 100644 --- a/app/mix/service/logic/vas_zone.go +++ b/app/mix/service/logic/vas_zone.go @@ -4,6 +4,7 @@ import ( "database/sql" "fmt" "go.mongodb.org/mongo-driver/bson/primitive" + "service/api/consts" "service/api/errs" vasproto "service/api/proto/vas/proto" zone_collaborator_proto "service/api/proto/zone_collaborator/proto" @@ -1095,13 +1096,14 @@ func (v *Vas) ZoneRefundV2(ctx *gin.Context, req *vasproto.ZoneRefundReq) error // 退款审核列表页 func (v *Vas) ZoneRefundList(ctx *gin.Context, req *vasproto.ZoneRefundListReq) (list []*dbstruct.RefundInfo, err error) { refundsStatusList := make([]int64, 0) - if req.AuditType == 1 { + if req.AuditType == consts.Unaudited { refundsStatusList = append(refundsStatusList, dbstruct.RefundsAwaiting) - } else if req.AuditType == 2 { + } else if req.AuditType == consts.Audited { refundsStatusList = append(refundsStatusList, dbstruct.RefundsApproved, dbstruct.RefundsRejected, dbstruct.RefundsOvertime) } list, err = v.store.GetZoneRefundList(ctx, req.Mid, refundsStatusList) if err != nil { + logger.Error("ZoneRefundList GetZoneRefundList fail, mid: %v, audit_type: %v, err: %v", req.Mid, req.AuditType, err) return } return @@ -1111,6 +1113,7 @@ func (v *Vas) ZoneRefundList(ctx *gin.Context, req *vasproto.ZoneRefundListReq) func (v *Vas) ZoneRefundInfo(ctx *gin.Context, req *vasproto.ZoneRefundInfoReq) (info *dbstruct.RefundInfo, err error) { info, err = v.store.GetZoneRefundInfo(ctx, req.AuditId) if err != nil { + logger.Error("ZoneRefundInfo GetZoneRefundInfo fail, mid: %v, audit_id: %v, err: %v", req.Mid, req.AuditId, err) return } return @@ -1121,6 +1124,7 @@ func (v *Vas) ZoneRefundAudit(ctx *gin.Context, req *vasproto.ZoneRefundAuditReq info, err := v.store.GetZoneRefundInfo(ctx, req.AuditId) if err != nil { + logger.Error("ZoneRefundAudit GetZoneRefundInfo fail, mid: %v, audit_id: %v, err: %v", req.Mid, req.AuditId, err) return err } @@ -1146,7 +1150,6 @@ func (v *Vas) UserRefundAuditTimes(ctx *gin.Context) error { list, err := v.store.GetRefundAudit(ctx) if err != nil { logger.Error("UserRefundAuditTimes GetRefundAudit fail ", err) - return err } ids := make([]string, 0)