PHPackages                             zqhong/redis-ranking - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. zqhong/redis-ranking

ActiveLibrary[Caching](/categories/caching)

zqhong/redis-ranking
====================

v0.2.0(8y ago)132313MITPHP

Since Jun 27Pushed 8y ago1 watchersCompare

[ Source](https://github.com/zqhong/redis-ranking)[ Packagist](https://packagist.org/packages/zqhong/redis-ranking)[ RSS](/packages/zqhong-redis-ranking/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (6)Dependencies (4)Versions (7)Used By (0)

Redis-Ranking
=============

[](#redis-ranking)

Redis-Ranking 库使用 Redis 的 SortedSet 存储排行数据。其中，

1. 使用 ZINCRBY 导入单条分数变更记录；
2. 使用 ZREVRANGE 获取 top x 的用户数据（按照 score 从大到小排序）；
3. 使用 ZRANK 获取某个用户的排名；
4. 使用 ZSCORE 获取某个用户的分数；

安装
==

[](#安装)

```
$ composer require -vvv zqhong/redis-ranking
```

使用
==

[](#使用)

```
