|
- public function check_action($where){
- $this->db->select('user_id,birthdate,sys_bank.name as bank_name,sys_department.name as department_name,sys_duties.name as duties_name');
- $this->db->from('sys_user');
- $this->db->join('sys_bank', 'sys_bank.bank_id=sys_user.bank_id');
- $this->db->join('sys_department','sys_department.department_id=sys_user.department_id');
- $this->db->join('sys_duties','sys_duties.id=sys_user.duties_id','left');
-
- $this->db->where($where);
-
- $query = $this->db->get();
- $data = $query->result_array();
- // echo $this->db->last_query();exit;
- return $data;
-
- }
复制代码- $this->load->model('shengri_model');
- $manage_id = $this->input->post('manage_id');
- $name = $this->input->post('name');
-
- $bs = strtotime($this->input->post('bs'));
- $fs = strtotime($this->input->post('fs'));
-
-
- $where = array();
- if(!empty($name)){
- $where['sys_department.name'] = $name;
- }
- if(!empty($manage_id)){
- $where['manage_id'] = $manage_id;
- }
- if(empty($name) && empty($manage_id)){
- success('c=coms&m=shengri','1');
- }
-
- $this->load->library('pagination');
- $perpage = 9;
-
- $config['base_url'] = site_url('c=coms&m=shengricheck');
- $config['total_rows'] = $this->shengri_model->return_query_num( $where );
- $config['per_page'] = $perpage;
- $config['first_link'] = '第一页';
- $config['prev_link'] = '上一页';
- $config['next_link'] = '下一页';
- $config['last_link'] = '最后一页';
- $this->pagination->initialize($config);
- $offset = $_GET['per_page'];
- $this->db->limit($perpage,$offset);
- $this->load->library('form_validation');
- $this->form_validation->set_rules('name');
- $this->form_validation->set_rules('manage_id');
- $status=$this->form_validation->run();
- if ($status){
-
- $data['links'] = $this->pagination->create_links();
-
- $data['category'] = $this->shengri_model->check_action($where);
-
- $this->load->view("commons/shengritongjicheck.html",$data);}else{
- echo 5656;
- }
-
- }
复制代码 分页能统计数据,但是第二页不显示,点击第二页echo1。相当于没有进行查动作。model中代码这样 |
|