tinywan/redis-paginate

redis cache paginate

dev-main 2022-05-06 09:48 UTC

This package is auto-updated.

Last update: 2024-10-06 15:16:16 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

安装

composer require tinywan/redis-paginate

使用

添加

$paginate = new Tinywan\Redis\Paginate();
$paginate->insert('2008','2022',['name'=>'tinywan']);

分页查询

$paginate = new Tinywan\Redis\Paginate();
$paginate->page('2008',1,10);

命令

  • 使用有序集合zadd
  • 使用hash存储具体的数据
  • 取数据通过有序集合的ZREVRANGE---递减排序