Commit 7b786808 by xuzhenhao

增加了redis工具库中的方法

1 parent c4ea784d
......@@ -541,7 +541,11 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
if err != nil {
return nil, rank.(string), err
}
igt[s].RankIndex = rank.(int)
count, err := RedisZCount(conn, "sortset:gtid:"+gtid+":gid:"+gid+":toptype:"+toptype, "-inf", "+inf")
if err != nil {
return nil, count.(string), err
}
igt[s].RankIndex = count.(int) - 1 - rank.(int)
igt[s].MyKey = strList[i+1]
//查询储存昵称以及头像url的redis
resultstr, err = RedisGetKV(redisConn, "GUID:"+igt[s].UID)
......
......@@ -258,3 +258,10 @@ func RedisZRevRangeByScore(conn redis.Conn, key string, startScore string, endSc
func RedisZScore(conn redis.Conn, key string, member string) (reply interface{}, err error) {
return RedisCommand(conn, "zscore", key, member)
}
/*
* zcount
*/
func RedisZCount(conn redis.Conn, key string, min string, max string) (reply interface{}, err error) {
return RedisCommand(conn, "zcount", key, min, max)
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!