TP5 分页(带参数传递)

不带参数:

$rs = Db::name('admin')->order(['id'=>'desc'])->paginate(1);

带参数传递:

$rs=Db::name('admin')->where($where)->order(['id'=>'desc'])->paginate(10,false,['query' => request()->param()]);

[‘query’ => request()->param()],有多少个参数传递都会自动给你增加上,不用一个一个参数这样子写的(->paginate(10,false,[‘query’ => [‘cate_id’=>$cate_id], [‘keyword’=>$keyword]]);  )

paginate(10,false,['query' => request()->param()]);