Commit 68faae46 by xuzhenhao

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

1 parent 3a0eb59e
Showing with 2 additions and 6 deletions
...@@ -445,7 +445,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri ...@@ -445,7 +445,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
igt := make([]IGT, len(strList)/2) igt := make([]IGT, len(strList)/2)
log.Println(igt) log.Println(igt)
log.Println(len(igt)) log.Println(len(igt))
index := 1 index := 0
var resultstr string var resultstr string
var valuecount = 2 var valuecount = 2
_, err = RedisDBSelect(redisConn, 4) _, err = RedisDBSelect(redisConn, 4)
...@@ -464,12 +464,8 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri ...@@ -464,12 +464,8 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
} else { } else {
s = i / 2 s = i / 2
} }
if prerankIndex+index-1 == rankIndex {
log.Println("set resIndex")
resIndex = index
}
igt[s].UID = currUID igt[s].UID = currUID
igt[s].RankIndex = prerankIndex + index igt[s].RankIndex = prerankIndex + index + 1
igt[s].MyKey = strList[i+1] igt[s].MyKey = strList[i+1]
//查询储存昵称以及头像url的redis //查询储存昵称以及头像url的redis
resultstr, err = RedisGetKV(redisConn, "GUID:"+igt[s].UID) resultstr, err = RedisGetKV(redisConn, "GUID:"+igt[s].UID)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!