From 82241a85749faff58c96c9abf856c4c9493b777d Mon Sep 17 00:00:00 2001 From: lwl0608 Date: Mon, 2 Sep 2024 15:23:25 +0800 Subject: [PATCH] fix --- app/mix/service/vasservice.go | 63 ++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/app/mix/service/vasservice.go b/app/mix/service/vasservice.go index 5ccd3dd2..b5f04d92 100644 --- a/app/mix/service/vasservice.go +++ b/app/mix/service/vasservice.go @@ -1317,43 +1317,46 @@ func (s *Service) SearchZoneMember(ctx *gin.Context, req *vasproto.SearchMemberR memMid := acnt.GetMid() // 获取成员列表 - //zmList, err := _DefaultVas.SearchZoneMember(ctx, zid, memMid) - //ec, err = errs.DealVasErr(err) - //if err != nil { - // logger.Error("ZoneRefund fail, err: %v", err) - // return - //} - //mids := make([]int64, 0) - //for _, zm := range zmList { - // mids = append(mids, zm.GetMid()) - //} - //logger.Info("SearchZoneMember, zid: %v, memUserId: %v, mids: %v, zmList: %v", zid, memUserId, mids, util.ToJson(zmList)) - - // 获取空间解锁信息 - zidZuMap, _ := _DefaultVas.GetZoneUnlockMapByMidZids(ctx, memMid, []int64{zid}) - zu := zidZuMap[zid] - if zu == nil || !zu.IsUnlockAdmission() { - err = fmt.Errorf("该用户没有解锁空间") - logger.Error("Not unlock admission, mid: %v, zid: %v, zu: %v, err: %v", memMid, zid, util.ToJson(zu), err) + zmList, err := _DefaultVas.SearchZoneMember(ctx, zid, memMid) + ec, err = errs.DealVasErr(err) + if err != nil { + logger.Error("ZoneRefund fail, err: %v", err) return } + mids := make([]int64, 0) + for _, zm := range zmList { + mids = append(mids, zm.GetMid()) + } + logger.Info("SearchZoneMember, zid: %v, memUserId: %v, mids: %v, zmList: %v", zid, memUserId, mids, util.ToJson(zmList)) // 获取用户信息 - mids := []int64{memMid} - acntMap, _ := _DefaultAccount.GetAccountMapByMids(ctx, mids) - logger.Info("GetAccountMapByMids, zid: %v, acntMap: %v", zid, util.ToJson(acntMap)) + //mids := []int64{memMid} + //acntMap, _ := _DefaultAccount.GetAccountMapByMids(ctx, mids) + //logger.Info("GetAccountMapByMids, zid: %v, acntMap: %v", zid, util.ToJson(acntMap)) + //if _, ok := acnt[memMid]; !ok { + // + //} + item := &vasproto.SearchMemberVO{ - JoinCt: zu.GetAdmissionCt(), + Account: acnt, + JoinCt: 0, + IsIronfan: 0, + IsSuperfan: 0, } - mid := zu.GetMid() - if acnt, ok := acntMap[mid]; ok { - item.Account = acnt + for _, zm := range zmList { + switch zm.GetMemberType() { + case dbstruct.ZoneMemberTypeNormal: + item.JoinCt = zm.GetCt() + case dbstruct.ZoneMemberTypeIronfan: + item.IsIronfan = 1 + case dbstruct.ZoneMemberTypeSuperfan: + item.IsSuperfan = 1 + } } - if zu.IsUnlockIronfanship() { - item.IsIronfan = 1 - } - if zu.IsUnlockSuperfanship() { - item.IsSuperfan = 1 + if item.JoinCt == 0 { + err = fmt.Errorf("该用户没有解锁空间") + logger.Error("Not unlock admission, mid: %v, zid: %v, item: %v, err: %v", memMid, zid, util.ToJson(item), err) + return } list = append(list, item) return