diff --git a/app/mix/controller/zone_vas_api.go b/app/mix/controller/zone_vas_api.go index b0dec7e4..43310297 100644 --- a/app/mix/controller/zone_vas_api.go +++ b/app/mix/controller/zone_vas_api.go @@ -80,6 +80,8 @@ func ZoneRefund(ctx *gin.Context) { ReplyErrCodeMsg(ctx, errcode.ErrCodeBadParam) return } + ReplyOk(ctx, nil) + ec, err := service.DefaultService.ZoneRefund(ctx, req) if ec != errcode.ErrCodeVasSrvOk { logger.Error("ZoneRefund fail, req: %v, ec: %v", util.ToJson(req), ec) @@ -90,7 +92,6 @@ func ZoneRefund(ctx *gin.Context) { ReplyErrCodeMsg(ctx, ec) return } - ReplyOk(ctx, nil) } func ZoneMemberList(ctx *gin.Context) { diff --git a/app/mix/service/logic/vas.go b/app/mix/service/logic/vas.go index 9607875e..ac8ffe50 100644 --- a/app/mix/service/logic/vas.go +++ b/app/mix/service/logic/vas.go @@ -2204,6 +2204,10 @@ func (v *Vas) UnlockMembership(ctx *gin.Context, tx *sqlx.Tx, mid int64, product return } +func getRefundLockKey(orderId string) string { + return fmt.Sprintf("refund_%s", orderId) +} + // 订单退款,只退充值 func (v *Vas) RefundOrder(ctx *gin.Context, req *vasproto.RefundOrderReq, opt *vasproto.RefundOrderOpt) error { // 获取订单 diff --git a/app/mix/service/logic/vas_zone.go b/app/mix/service/logic/vas_zone.go index e3cb67e5..c7289d3b 100644 --- a/app/mix/service/logic/vas_zone.go +++ b/app/mix/service/logic/vas_zone.go @@ -921,6 +921,8 @@ func (v *Vas) ZoneRefund(ctx *gin.Context, req *vasproto.ZoneRefundReq) error { if time.Now().Unix()-t < 3600*12 { return fmt.Errorf("12小时内您最多只能进行1次退款") } + // redis记录退款时间 + _ = redisCli.Set(redisKey, time.Now().Unix(), 86400) // 获取解锁信息 zv, err := v.store.GetZoneUnlock(ctx, nil, req.Mid, req.Zid) @@ -961,9 +963,6 @@ func (v *Vas) ZoneRefund(ctx *gin.Context, req *vasproto.ZoneRefundReq) error { return err } - // redis记录退款时间 - _ = redisCli.Set(redisKey, time.Now().Unix(), 86400) - return nil }