CodeIgniter 搜尋分頁有點有關問題,幫忙看下

來源:互聯網
上載者:User
CodeIgniter 搜尋分頁有點問題,幫忙看下
我的查詢條件比較多,所以可能稍微顯得長了點,分頁是可以用,但是點擊下一頁,跳轉到第二頁的時候,下面的當前頁並不是第二頁!請指教。

主要問題就是,點擊下一頁的時候,已經跳轉到下一頁,但是當前頁顯示不正確!控制器
PHP code
function people_daozhen($askdate,$askdate2,$name,$age,$age2,$phone,$sex,$zxjb,$comefrom,$area){                                                                if(!empty($_POST['askdate'])){                        $data ['askdate']=$_POST['askdate'];                }                        if(!empty($_POST['askdate2'])){                        $data ['askdate2']=$_POST['askdate2'];                }                if(!empty($_POST['name'])){                        $data ['name']=$_POST['name'];                }                if(!empty($_POST['age'])){                        $data ['age']=$_POST['age'];                }                if(!empty($_POST['age2'])){                        $data ['age2']=$_POST['age2'];                }                if(!empty($_POST['phone'])){                        $data ['phone']=$_POST['phone'];                }                if(!empty($_POST['sex'])){                        $data ['sex']=$_POST['sex'];                }                if(!empty($_POST['zxjb'])){                        $data ['zxjb']=$_POST['zxjb'];                }                if(!empty($_POST['comefrom'])){                        $data ['comefrom']=$_POST['comefrom'];                }                if(!empty($_POST['area'])){                        $data ['area']=$_POST['area'];                }                                                $this->load->helper ( 'url' );                $this->load->database();                   $this->load->library ( 'pagination' );                                                $config ['per_page'] = '10';                $config ['base_url'] = base_url(). 'index.php/people/people_daozhen/'.$askdate.'/'.$askdate2.'/'.$name.'/'.$age.'/'.$age2.'/'.$phone.'/'.$sex.'/'.$zxjb.'/'.$comefrom.'/'.$area;                                $this->load->model ( 'people_mdl','',TRUE );                 $data ['datalist']  = $this->people_mdl->people_list2 ( $config ['per_page'], $this->uri->segment ( 13 ) ,$askdate,$askdate2,$name,$age,$age2,$phone,$sex,$zxjb,$comefrom,$area);                $config ['total_rows'] =$this->people_mdl->people_sum2($askdate,$askdate2,$name,$age,$age2,$phone,$sex,$zxjb,$comefrom,$area);                                $config['uri_segment'] = 3;                $config ['full_tag_open'] = '

'; $config ['full_tag_close'] = '

'; $config ['first_link'] = '首頁'; $config ['first_tag_open'] = '
  • '; $config ['first_tag_close'] = '
  • '; $config ['last_link'] = '尾頁'; $config ['last_tag_open'] = '
  • '; $config ['last_tag_close'] = '
  • '; $config ['next_link'] = '下一頁'; $config ['next_tag_open'] = '
  • '; $config ['next_tag_close'] = '
  • '; $config ['prev_link'] = '上一頁'; $config ['prev_tag_open'] = '
  • '; $config ['prev_tag_close'] = '
  • '; $config ['cur_tag_open'] = '
  • '; $config ['cur_tag_close'] = '
  • '; $config ['num_tag_open'] = '
  • '; $config ['num_tag_close'] = '
  • '; $this->pagination->initialize ( $config ); $this->load->view ( 'admin/people_daozhen', $data ); }

    模型


    PHP code
            function people_list2($per_nums, $start_position,$askdate,$askdate2,$name,$age,$age2,$phone,$sex,$zxjb,$comefrom,$area){                if($askdate!=0){                        $this->db->where('askdate >=',$askdate);                }                if($askdate2!=0){                        $this->db->where('askdate <=',$askdate2);                }                if($name!=0){                        $this->db->like('username',$name);                }                if($age!=0){                        $this->db->where('age >=',$age);                }                if($age2!=0){                        $this->db->where('age <=',$age2);                }                if($phone!=0){                        $this->db->like('phone',$phone);                }                if($sex!=0){                        $this->db->where('sex',$sex);                }                if($zxjb!=0){                        $this->db->where('zxjb',$zxjb);                }                if($comefrom!=0){                        $this->db->where('comefrom',$comefrom);                }                if($area!=0){                        $this->db->where('area',$area);                }                                if($askdate!=0){                        $this->db->where('askdate >=',$askdate);                }                                $this->db->order_by("pid", "desc");                 $query = $this->db->get ($_SESSION['user']->table, $per_nums, $start_position );                $datas['array']=$query->result_array();                $datas['rows']=$query->num_rows();                return $query->result_array();        }                function people_sum2($askdate,$askdate2,$name,$age,$age2,$phone,$sex,$zxjb,$comefrom,$area){                if($askdate!=0){                        $this->db->where('askdate >=',$askdate);                }                if($askdate2!=0){                        $this->db->where('askdate <=',$askdate2);                }                if($name!=0){                        $this->db->like('username',$name);                }                if($age!=0){                        $this->db->where('age >=',$age);                }                if($age2!=0){                        $this->db->where('age <=',$age2);                }                if($phone!=0){                        $this->db->like('phone',$phone);                }                if($sex!=0){                        $this->db->where('sex',$sex);                }                if($zxjb!=0){                        $this->db->where('zxjb',$zxjb);                }                if($comefrom!=0){                        $this->db->where('comefrom',$comefrom);                }                if($area!=0){                        $this->db->where('area',$area);                }                                $query = $this->db->get ($_SESSION['user']->table);                return $query->num_rows();        } 
  • 相關文章

    聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.