This commit is contained in:
lwl0608 2024-09-02 15:23:25 +08:00
parent f330f61a6f
commit 82241a8574
1 changed files with 33 additions and 30 deletions

View File

@ -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