分页报错

浏览:111 发布日期:2019/12/06 分类:求助交流
model代码
class Colum extends Model{

//无限分类查询
public function select_all(){
$data=$this->paginate(10);
return $this->select_type($data);
}
public function select_type($dat,$pid=0,$leave=0){
static $arr=array();
foreach ($dat as $key => $value) {
if($value['pid']==$pid){
$value['leave']=$leave;
$arr[]=$value;
$this->select_type($dat,$value['id'],$leave+2);
}
}
return $arr;
}

}

controller代码

public function index(){
//实例化model
$colunmo=new colunModel;
$data=$colunmo->select_all();
$this->assign('dat',$data);
return $this->fetch();
}

页面代码
{$dat->render()}
最佳答案
评论( 相关
后面还有条评论,点击查看>>