thinkPHP3.2.3结合Laypage实现的分页功能示例
发布时间:2020-12-14 14:10:24 所属栏目:大数据 来源:网络整理
导读:本篇章节讲解thinkPHP3.2.3结合Laypage实现的分页功能。供大家参考研究具体如下: 控制器 count())/10); $infos=D('data')->limit(($nowpage-1)*10,10)->select(); }else{ $totalpage=ceil((D('data')->where($c)->count())/10); $infos=D('data')
本篇章节讲解thinkPHP3.2.3结合Laypage实现的分页功能。分享给大家供大家参考,具体如下: 控制器count())/10);
$infos=D('data')->limit(($nowpage-1)*10,10)->select();
}else{
$totalpage=ceil((D('data')->where($c)->count())/10);
$infos=D('data')->where($c)->limit(($nowpage-1)*10,10)->select();
}
}else{
if($choose == -6)
{
$map['data'] = array('like',"%$type%");
$totalpage=ceil((D('data')->where($map)->count())/10);
$infos=D('data')->where($map)->limit(($nowpage-1)*10,10)->select();
}else{
$map['data'] = array('like',"%$type%");
$totalpage=ceil((D('data')->where($map)->where($c)->count())/10);
$infos=D('data')->where($map)->where($c)->limit(($nowpage-1)*10,10)->select();
}
}
$this->assign('type',$type);
$this->assign('choose',$choose);
$this->assign("totalpage",$totalpage);
$this->assign("infos",$infos);
$this -> display();
}
}
视图层
Think Demo
" id="type">
|