TP5.1 分页(带参数传递)

不带参数:

$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]]);  )

参考:https://blog.csdn.net/h330531987/article/details/78319595

来源:https://www.cnblogs.com/cl94/p/10281571.html

posted @ 2020-04-28 11:13  1O(∩_∩)O1  阅读(503)  评论(0编辑  收藏  举报