//$arr = array(); //if(!empty($arr)){ //foreach ($arr as $key => $value) { //foreach ($value['productList'] as $k => $v) { //$list[] = $v; //} //} //} $list = array(); $page = ($_GET['offset']/10) + 1; $pagesize = $_GET['limit']; if($page == 1){ $data = []; foreach ($list as $key => $value) { if($key < $pagesize){ $data[] = $value; } } } if($page > 1){ $data = []; foreach ($list as $key => $value) { if(($key >= (($page-1) * $pagesize)) && ($key <= (($page * $pagesize) - 1))){ $data[] = $value; } } } return json(['total'=>count($list),'rows'=>$data]);
标签:分页,fastadmin,list,value,查询,foreach,key,data,page From: https://www.cnblogs.com/web928943/p/17525394.html