$arr = [ ['date' => "2021-07-10"], ['date' => "2021-07-11"], ['date' => "2021-07-12"], ['date' => "2021-07-13"], ['date' => "2021-07-14"], ['date' => "2021-07-15"], ['date' => "2021-07-16"], ['date' => "2021-07-17"], ['date' => "2021-07-18"], ['date' => "2021-07-19"], ['date' => "2021-07-20"], ['date' => "2021-07-21"], ['date' => "2021-07-22"], ]; $curPage = input('page') ? input('page') : 1;//传递过来的页码 $Row = 10;//每页显示的条数 $list = array_slice($arr, ($curPage - 1) * $Row, $Row,true);// 数组中根据分页返回的值 $p = Bootstrap::make($list , $Row, $curPage, count($arr ), false, [ 'var_page' => 'page', 'path' => url('/home/Train/trainList'),//这里是url 'query' => request()->param(),//这里是带着参数,防止条件参数丢失 ]); $this->assign('list', $list);//这里是数据 $this->assign('page', $p->render());//这里是分页