Commit 37f2aab8 by xuzhenhao

增加了redis工具库中的方法

1 parent 778a5029
Showing with 3 additions and 3 deletions
...@@ -429,7 +429,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri ...@@ -429,7 +429,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
prerankIndex = rankIndex - prerankIndex prerankIndex = rankIndex - prerankIndex
} }
nextrankIndex = rankIndex + nextrankIndex nextrankIndex = rankIndex + nextrankIndex
log.Println("nextrankIndex:", nextrankIndex, "prerankIndex:", prerankIndex)
// 排序 // 排序
var strList, strList1, strList2 []string var strList, strList1, strList2 []string
if sorceorder == "1" { if sorceorder == "1" {
...@@ -438,7 +438,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri ...@@ -438,7 +438,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
if err != nil { if err != nil {
log.Println("zrangebyscore:", err) log.Println("zrangebyscore:", err)
} }
log.Println("strList1 : ", strList1)
} }
if prerankIndex != 0 { if prerankIndex != 0 {
strList2, err = RedisZRevRangeByScore(redisConn, "sortset:gtid:"+gtid+":gid:"+gid+":toptype:"+toptype, scoreString, "-inf", "true", 0, prerankIndex) strList2, err = RedisZRevRangeByScore(redisConn, "sortset:gtid:"+gtid+":gid:"+gid+":toptype:"+toptype, scoreString, "-inf", "true", 0, prerankIndex)
...@@ -452,6 +452,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri ...@@ -452,6 +452,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
tempList = append(tempList, strList2[i]) tempList = append(tempList, strList2[i])
} }
strList2 = tempList strList2 = tempList
log.Println("strList2 : ", strList2)
} }
if len(strList2) == 0 { if len(strList2) == 0 {
strList = append(strList, "ice_gametop:uid:"+uid+":gtid:"+gtid+":gid:"+gid+":toptype:"+toptype+":mykey") strList = append(strList, "ice_gametop:uid:"+uid+":gtid:"+gtid+":gid:"+gid+":toptype:"+toptype+":mykey")
...@@ -498,7 +499,6 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri ...@@ -498,7 +499,6 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
strList = append(strList, strList2...) strList = append(strList, strList2...)
} }
} }
} }
if err != nil { if err != nil {
resIndex = "105203" resIndex = "105203"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!