容错处理 防止玩家数据不多的时候未创角的号入榜
This commit is contained in:
parent
c309920b31
commit
25a7fcf2c0
@ -77,8 +77,10 @@ func (this *modelCaravan) GetRankListData(rankNum int32, uid string) (list []*pb
|
||||
for _data.Next(context.TODO()) {
|
||||
temp := &pb.DBUser{}
|
||||
if err = _data.Decode(temp); err == nil {
|
||||
if temp.Name == "" { // 容错处理 防止没有创号的玩家入榜
|
||||
continue
|
||||
}
|
||||
ipos++
|
||||
|
||||
list = append(list, &pb.CaravanRankInfo{
|
||||
Uid: temp.Uid,
|
||||
Name: temp.Name,
|
||||
|
Loading…
Reference in New Issue
Block a user