1. 程式人生 > >thinksns 分頁數據

thinksns 分頁數據

eat spl use lin etc 翻頁 fir lec pager

        $syscode = M(‘SystemCode‘); // 實例化User對象
        $count   = $syscode->where(‘code_state=0‘)->count();// 查詢滿足要求的總記錄數
        $list = $syscode->where(‘code_state=0‘)->order(‘create_time desc‘)->page($page.‘,‘.$rows)->select();

        //生成翻頁HTML代碼
        C(‘VAR_PAGE‘, ‘page‘);
        
$pager = new \Think\PageBack($count, $rows, $_REQUEST); $pager->setConfig(‘theme‘, ‘%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%‘); $paginationHtml = $pager->show(); $this->assign(‘list‘,$list);// 賦值數據集 $this->assign(‘page‘,$paginationHtml);// 賦值分頁輸出
$this->display();

thinksns 分頁數據