Commit 84dfb010 by xuzhenhao

增加了redis工具库中的方法

1 parent 0713e59e
Showing with 4 additions and 3 deletions
......@@ -442,7 +442,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
log.Println("strList1 : ", strList1)
}
if prerankIndex != 0 {
strList2, err = RedisZRevRangeByScore(redisConn, "sortset:gtid:"+gtid+":gid:"+gid+":toptype:"+toptype, "-inf", scoreString, "true", 0, prerankIndex)
strList2, err = RedisZRevRangeByScore(redisConn, "sortset:gtid:"+gtid+":gid:"+gid+":toptype:"+toptype, scoreString, "-inf", "true", 0, prerankIndex)
if err != nil {
log.Println("zrevrangebyscore:", err)
}
......@@ -472,7 +472,8 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
} else if sorceorder == "0" {
if prerankIndex != 0 {
strList1, err = RedisZRevRangeByScore(redisConn, "sortset:gtid:"+gtid+":gid:"+gid+":toptype:"+toptype, "-inf", scoreString, "true", 0, prerankIndex)
strList1, err = RedisZRevRangeByScore(redisConn, "sortset:gtid:"+gtid+":gid:"+gid+":toptype:"+toptype, scoreString, "-inf", "true", 0, prerankIndex)
log.Println("strList1 : ", strList1)
//将结果倒序
var tempList []string
for i := len(strList1); i < 0; i -= 2 {
......@@ -480,7 +481,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
tempList = append(tempList, strList1[i])
}
strList1 = tempList
log.Println("strList1 : ", strList1)
log.Println("tempList : ", strList1)
}
if nextrankIndex != 0 {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!