0
codeigniter 페이지 매김 클래스를 사용하고 있으며이 코드에 고정되어 있습니다! 다음 코드는 employees 테이블에서 전체 열을 읽지 만 내 쿼리에는 조인이 포함되어 있습니다. 구성 설정을 사용하여 내 자신의 쿼리를 어떻게 실행할 것인지 잘 모르겠습니다.맞춤법 검사기 코드 지정자 페이지 지정 클래스
$config['per_page'] = 20;
$view_data['view_data'] = $this->db->get('employees', $config['per_page'], $this->uri->segment(3));
내 자신의 쿼리 :
$this->db->select('emp.code as emp_code,emp.fname as emp_fname,emp.lname as emp_lname,emp.faname as emp_faname,emp.awcc_phone as emp_phone,emp.awcc_email as emp_email,position as position,dep.title as department');
$this->db->from('employees as emp');
$this->db->join('departments as dep','dep.code=emp.department_code');
$this->db->where('emp.status = 1');
$employees_list = $this->db->get();
return $employees_list;