public function getList($pid = 0, $pageSize = 10)
 {
     if ($pid) {
         $where['pid'] = $pid;
     }
     $where['tid'] = 1;
     $count = $this->where($where)->count();
     // 查询满足要求的总记录数
     $Page = new \Think\Page($count, $pageSize);
     $show = $Page->show();
     // 分页显示输出
     $showPage = $Page->showPage();
     // 分页显示输出
     $list = $this->where($where)->order('time desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
     foreach ($list as $k => &$v) {
         //处理留言数据
         //父级留言
         if ($v['nid']) {
             $v['nodeList'] = $this->where('id=' . $v['nid'])->field('name,address,comment')->find();
         }
     }
     $rs['showPage'] = $showPage;
     $rs['count'] = $count;
     $rs['list'] = $list;
     $rs['page'] = $show;
     return $rs;
 }
Beispiel #2
0
 public function getList($where, $page_size = 10)
 {
     $count = $this->where($where)->order('time desc')->count();
     // 查询满足要求的总记录数
     $Page = new \Think\Page($count, $page_size);
     $show = $Page->show();
     // 分页显示输出
     $showPage = $Page->showPage();
     // 分页显示输出
     $list = $this->where($where)->field('ey_moods.*,ey_users.img,ey_users.user as name')->limit($Page->firstRow . ',' . $Page->listRows)->join('ey_users ON ey_moods.uid=ey_users.id')->order('time desc')->select();
     $rs['count'] = $count;
     $rs['showPage'] = $showPage;
     $rs['list'] = $list;
     $rs['page'] = $show;
     return $rs;
 }
Beispiel #3
0
 public function getList($where = null, $pageSize = 10)
 {
     $count = $this->where($where)->count();
     // 查询满足要求的总记录数
     $Page = new \Think\Page($count, $pageSize);
     $show = $Page->show();
     // 分页显示输出
     $showPage = $Page->showPage();
     // 分页显示输出
     $list = $this->where($where)->order('time desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
     $rs['showPage'] = $showPage;
     $rs['count'] = $count;
     $rs['list'] = $list;
     $rs['page'] = $show;
     return $rs;
 }
 public function getList($where = null, $page_size = 5)
 {
     //传入条件,显示条数
     $count = $this->where($where)->count();
     // 查询满足要求的总记录数
     $Page = new \Think\Page($count, $page_size);
     $show = $Page->show();
     // 分页显示输出
     $showPage = $Page->showPage();
     // 分页显示输出
     $list = $this->where($where)->join("ey_categorys ON ey_contents.cid=ey_categorys.id")->join('ey_tags ON ey_contents.tid=ey_tags.id')->join('ey_users ON ey_contents.uid=ey_users.id')->field('ey_contents.*,ey_categorys.name as cate,ey_tags.name as tag,ey_users.user as name')->order('time desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
     $rs['list'] = $list;
     //集合
     $rs['page'] = $show;
     //分页
     $rs['showPage'] = $showPage;
     //分页
     $rs['count'] = $count;
     //总数
     return $rs;
 }