zoukankan      html  css  js  c++  java
  • tp3.2展示列表

     public function get_list($where=array(),$field="",$order = "id desc"){
            $field = empty($field)?"id,dy_url,start_num,end_num,is_pay,create_time,total_num,now_num,speed,status":$field;
            $count=$this->where($where)->count();
            $Page=get_page($count);
            $data['page'] = $Page->show();
            $data['list'] = $this->where($where)->field($field)->order($order)->limit($Page->firstRow.','.$Page->listRows)->select();
            return $data;
        }
    /**
     * 获取分页
     * @param int $count 数据总行数
     */
    function get_page($count){
        $listRows = 10;
        $Page= new ThinkPage($count,$listRows);
        $Page->rollPage = 5;
        $Page->setConfig('prev','上一页');
        $Page->setConfig('next','下一页');
        $Page->setConfig('first','首页');
        return $Page;
    }
    
  • 相关阅读:
    BETA 版冲刺前准备
    alpha事后诸葛亮
    alpha冲刺10
    alpha冲刺9
    alpha冲刺8
    alpha冲刺7
    alpha冲刺6
    alpha冲刺5
    第十一次作业
    Alpha冲刺一 (10/10)
  • 原文地址:https://www.cnblogs.com/phpwyl/p/10272220.html
Copyright © 2011-2022 走看看