From a1a414d6dad4fcf3dd605343dd817ed750edbd56 Mon Sep 17 00:00:00 2001 From: lwl0608 Date: Sat, 12 Oct 2024 16:33:58 +0800 Subject: [PATCH] fix --- api/proto/vas/proto/op.go | 9 +++++++-- app/mix/service/logic/vas_zone.go | 2 +- app/mix/service/vasservice.go | 18 ++++++++++++++++-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/api/proto/vas/proto/op.go b/api/proto/vas/proto/op.go index 2ec2c1ee..20cf2cb8 100644 --- a/api/proto/vas/proto/op.go +++ b/api/proto/vas/proto/op.go @@ -154,6 +154,11 @@ type OpGetWithdrawFreezeListReq struct { base.BaseRequest } -type OpGetWithdrawFreezeListData struct { - List []*dbstruct.WithdrawFreeze `json:"list"` +type WithdrawFreezeVO struct { + *dbstruct.WithdrawFreeze + Account *dbstruct.Account `json:"account"` +} + +type OpGetWithdrawFreezeListData struct { + List []*WithdrawFreezeVO `json:"list"` } diff --git a/app/mix/service/logic/vas_zone.go b/app/mix/service/logic/vas_zone.go index abbe7f76..4ac13812 100644 --- a/app/mix/service/logic/vas_zone.go +++ b/app/mix/service/logic/vas_zone.go @@ -56,7 +56,7 @@ func (v *Vas) UpdateZoneVasInfo(ctx *gin.Context, req *vasproto.UpdateZoneVasReq if req.AdmissionPrice <= 0 && req.IronfanshipPrice <= 0 && req.SuperfanshipPrice <= 0 { return nil } - if req.IsSuperfanshipEnabled == 1 && len(req.SuperfanPriceList) < 5 { + if len(req.SuperfanPriceList) > 0 && len(req.SuperfanPriceList) != 5 { err1 := fmt.Errorf("SuperfanPriceList not fit length, req: %v", util.ToJson(req)) return err1 } diff --git a/app/mix/service/vasservice.go b/app/mix/service/vasservice.go index 540949f8..280040d1 100644 --- a/app/mix/service/vasservice.go +++ b/app/mix/service/vasservice.go @@ -1500,16 +1500,30 @@ func (s *Service) OpDelWithdrawFreeze(ctx *gin.Context, req *vasproto.OpDelWithd return } -func (s *Service) OpGetWithdrawFreezeList(ctx *gin.Context, req *vasproto.OpGetWithdrawFreezeListReq) (list []*dbstruct.WithdrawFreeze, ec errcode.ErrCode, err error) { +func (s *Service) OpGetWithdrawFreezeList(ctx *gin.Context, req *vasproto.OpGetWithdrawFreezeListReq) (list []*vasproto.WithdrawFreezeVO, ec errcode.ErrCode, err error) { defer func() { ec, err = errs.DealVasErr(err) }() - list, err = _DefaultVas.GetWithdrawFreezeList(ctx) + listTmp, err := _DefaultVas.GetWithdrawFreezeList(ctx) if err != nil { logger.Error("GetWithdrawFreezeList fail, req: %v, err: %v", util.ToJson(req), err) return } + + mids := make([]int64, 0) + for _, v := range listTmp { + mids = append(mids, v.Mid) + } + acntMap, _ := _DefaultAccount.GetAccountMapByMids(ctx, mids) + + list = make([]*vasproto.WithdrawFreezeVO, 0) + for _, v := range listTmp { + list = append(list, &vasproto.WithdrawFreezeVO{ + WithdrawFreeze: v, + Account: acntMap[v.Mid], + }) + } return }