- $switch = I('switchs');
- if($switch == 1){
- $book_id = I('cate');
- $_SESSION['book_id']=$book_id;}
- if($_SESSION['book_id']!=0){
- $total = D('BookPostView')->where(array('status'=>1,'book_id'=>$_SESSION['book_id']))->count();
- $Page = new \Think\Page($total,10,array(),'','id','');
- $Page->setConfig('theme', '%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% ');
- $page = $Page->show();
- $this->assign('page', $page);
- $list = D('BookPostView')->where(array('status'=>1,'book_id'=>$_SESSION['book_id']))->limit($Page->firstRow . ',' . $Page->listRows)->order('id desc')->select();
- }else{
- $total = D('BookPostView')->where(array('status'=>1))->count();
- $Page = new \Think\Page($total,10,array(),'','id','');
- $Page->setConfig('theme', '%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% ');
- $page = $Page->show();
- $this->assign('page', $page);
- $list = D('BookPostView')->where(array('status'=>1))->limit($Page->firstRow . ',' . $Page->listRows)->order('id desc')->select();
- }
- $bookpost = M('book')->where(array('cate_type'=>1))->select();
- $this->bookposts = list_to_tree($bookpost);
- $this->assign('list',$list);
- $this->assign('cateInfo',$cateInfo);
- $this->assign('catelevel',count($cateInfo));
- $this->assign('title',$cateInfo['current']['typename']);
- $this->display();
- }
- //模板文件
- method="post">
- "hidden" name="switchs" value="1"/>
- {:W('Book/cateChoose',array('wid'=>'takebook'))}
- "submit" class="btn submit-btn " value="筛选"/>
上一篇 商品列表弹出遮罩层