|
表单提交查询后,分页
因为有多个页
但是取下一页的时间,通过表单提交的值却变了,怎么才能让值不变
我在控制器中没有传其它参数
比如
控制器
function get_test()
{
$this->load->model('model_zjcy','',true);
$this->load->library('pagination');
$count=$this->model_zjcy->get_test_list
$page_cfg['base_url'] = base_url(). "/do.php/zjcy/get_test/";
$page_cfg['total_rows'] =$count->num_rows();
$page_cfg['per_page'] = '20';
$page_cfg['full_tag_open'] = '<p>';
$page_cfg['full_tag_close'] = '</p>';
$page_cfg['first_link'] = '首页';
$page_cfg['last_link'] = '尾页';
$this->pagination->initialize($page_cfg);
$data['page_links'] = $this->pagination->create_links();
$data['rctj'] =$this->model_zjcy->get_test_list($page_cfg['per_page'],$this->uri->segment(3));
$this->load->view('zjcy/zjcy_test',$data);
}
模型:
function get_test_list($num="",$offset="")
{
$this->db->select('test.*');
$this->db->from('test');
$this->db->where('test.sex', $this->input->post('sex'));
$this->db->where('test.qualifications', $this->input->post('qualifications'));
$this->db->like('posts',$this->input->post('posts'),'both');
$this->db->like('address',$this->input->post('address'),'both');
$this->db->orderby("pubdate", "desc");
$this->db->limit($num,$offset);
$query = $this->db->get();
return $query;
}
}
只要我取下一页时,所取的值就不是我想得到的值
这个是为什么
请高手帮帮忙 |
|