Commit bd88237c by xuzhenhao

修复了返回索引错误的问题

1 parent 56f9c46d
Showing with 3 additions and 0 deletions
......@@ -385,6 +385,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
// 获取当前用户排名
rank, err := RedisZRank(redisConn, "sortset:gtid:"+gtid+":gid:"+gid+":toptype:"+toptype, "ice_gametop:uid:"+uid+":gtid:"+gtid+":gid:"+gid+":toptype:"+toptype+":mykey")
if err != nil {
k
resIndex = "105202"
return nil, resIndex, err
}
......@@ -418,7 +419,9 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
}
if rankIndex-prerankIndex < 0 {
prerankIndex = 0
resIndex = rankIndex + 1
} else {
resIndex = prerankIndex + 1
prerankIndex = rankIndex - prerankIndex
}
nextrankIndex = rankIndex + nextrankIndex
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!