tp3 key json 分页

 //json 强制转换为array

$arr[$key]['checkpro'] = json_decode($val['checkpro'],JSON_FORCE_ARRAY);
    $arr[$key]['messpro'] = json_decode($val['messpro'],JSON_FORCE_ARRAY);

{$Think.lang.$key}

$pro = D('Project');
        $count = $pro->where('status != -1')->count();
       
        $page = new \Think\Page($count,8);  
        $data = $pro->alias('p')
        ->field('m.realname,p.*,d.dname')
        ->where('p.status !=-1 ')
        ->join(' left join ganen_member m on p.charge = m.uid')
        ->join(' left join ganen_department d on p.pro_id = d.did')
        ->limit($page->firstRow.','.$page->listRows)
        ->select();  
        $page->setConfig('first','首页');
        $page->setConfig('last','末页');
        $page->setConfig('prev','上一页');
        $page->setConfig('next','下一页');
        $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%');
        $show = $page->show();

        $this->assign('_page',$show);  
        $this->assign('_list', $data);
        $this->meta_title = '用户信息';
        $this->display();

posted @ 2017-09-02 09:36  zhangsima  阅读(222)  评论(0编辑  收藏  举报