public function pagingSel(Request $request){
//原生
$param = $request->param();
$offset=($param['page']-1)*$param['limit'];
$data = \app\admin\model\article::limit($offset,$param['limit'])->order('id','esc')->select();
$count = \app\admin\model\article::count();
//进阶
// $data=\app\admin\model\article::order('id','esc')->paginate(5);
// $data &&$data=$data->toArray();
return json(['code'=>0,'msg'=>'成功','data'=>$data,'count'=>$count]);
}
layui 分页展示
最新推荐文章于 2024-07-24 09:36:45 发布