diff --git a/app/mix/controller/vas.go b/app/mix/controller/vas.go index 31c2d803..2886564f 100644 --- a/app/mix/controller/vas.go +++ b/app/mix/controller/vas.go @@ -336,7 +336,7 @@ func isWithdrawAnyDiasEnable(mid int64) bool { // 提现发送验证码 func WithdrawSendVerifycode(ctx *gin.Context) { req := ctx.MustGet("client_req").(*vasproto.WithdrawSendVerifycodeReq) - if isWithdrawFreeze(req.Mid) { + if service.DefaultService.IsWithdrawFreeze(ctx, req.Mid) { ReplyErrorMsg(ctx, "当前提现功能已冻结") return } @@ -354,7 +354,7 @@ func WithdrawApply(ctx *gin.Context) { //ReplyErrorMsg(ctx, "提现功能维护中,请72小时后再试") //return req := ctx.MustGet("client_req").(*vasproto.WithdrawApplyReq) - if isWithdrawFreeze(req.Mid) { + if service.DefaultService.IsWithdrawFreeze(ctx, req.Mid) { ReplyErrorMsg(ctx, "当前提现功能已冻结") return } diff --git a/app/mix/dao/mongo_vas.go b/app/mix/dao/mongo_vas.go index 1a7a1896..b34d8384 100644 --- a/app/mix/dao/mongo_vas.go +++ b/app/mix/dao/mongo_vas.go @@ -334,3 +334,20 @@ func (m *Mongo) GetWithdrawFreezeByUserId(ctx *gin.Context, userId int64) (*dbst } return doc, nil } + +func (m *Mongo) GetWithdrawFreezeByMid(ctx *gin.Context, mid int64) (*dbstruct.WithdrawFreeze, error) { + doc := new(dbstruct.WithdrawFreeze) + col := m.getColWithdrawFreeze() + query := qmgo.M{ + "mid": mid, + } + err := col.Find(ctx, query).One(&doc) + if err == qmgo.ErrNoSuchDocuments { + err = nil + return nil, nil + } + if err != nil { + return nil, err + } + return doc, nil +} diff --git a/app/mix/service/logic/vas.go b/app/mix/service/logic/vas.go index d4935952..70e85764 100644 --- a/app/mix/service/logic/vas.go +++ b/app/mix/service/logic/vas.go @@ -4290,3 +4290,11 @@ func (v *Vas) GetWithdrawFreezeByUserId(ctx *gin.Context, userId int64) (*dbstru func (v *Vas) GetWithdrawFreezeList(ctx *gin.Context) ([]*dbstruct.WithdrawFreeze, error) { return v.store.GetWithdrawFreezeList(ctx) } + +func (v *Vas) IsWithdrawFreeze(ctx *gin.Context, mid int64) bool { + doc, _ := v.store.GetWithdrawFreezeByMid(ctx, mid) + if doc != nil { + return true + } + return false +} diff --git a/app/mix/service/vasservice.go b/app/mix/service/vasservice.go index f57c4d78..9c0ce99c 100644 --- a/app/mix/service/vasservice.go +++ b/app/mix/service/vasservice.go @@ -1457,6 +1457,9 @@ func (s *Service) OpDelWithdrawFreeze(ctx *gin.Context, req *vasproto.OpDelWithd defer func() { ec, err = errs.DealVasErr(err) }() + defer func() { + _ = _DefaultHistory.WriteOne(ctx, dbstruct.HistoryTypeVas, "del_withdraw_freeze", req, nil, nil) + }() err = _DefaultVas.DelWithdrawFreeze(ctx, req.UserId) if err != nil { @@ -1478,3 +1481,7 @@ func (s *Service) OpGetWithdrawFreezeList(ctx *gin.Context, req *vasproto.OpGetW } return } + +func (s *Service) IsWithdrawFreeze(ctx *gin.Context, mid int64) bool { + return _DefaultVas.IsWithdrawFreeze(ctx, mid) +}