1464 emp list

This commit is contained in:
rajasekar 2019-03-21 13:32:44 +05:30
parent c3c3381e23
commit 537d0e4d32

View File

@ -175,7 +175,7 @@ class Employee_model extends CI_Model
// not for SuperAdmin and Student Role code
$this->db->where_not_in('t1.StaffID', $staffId);
// $this->db->group_by('t3.StaffID');
// $this->db->where('BranchCode', $loginUserBranchId);
// $this->db->where('BranchCode', $loginUserBranchId);
$empDetails = $this->db->get();
$checkArr = $empDetails->result();
if (count($checkArr) > 0) {
@ -200,6 +200,7 @@ class Employee_model extends CI_Model
$this->db->order_by('t1.CreatedOn', 'DESC');
$empDetails = $this->db->get();
$checkArr = $empDetails->result();
// print_r($this->db->last_query());die();
if (count($checkArr) > 0) {
$results['employeeList'] = true;
$results['employees_details'] = $empDetails->result();
@ -213,17 +214,19 @@ class Employee_model extends CI_Model
} else if ($loginUserType == ADMIN) {
// list for admin
$staffId = $this->selfGetEmpId($loginUserId);
$this->db->select('t2.*');
$this->db->distinct();
$this->db->select('t1.*,t2.*');
$this->db->from('' . STAFF_BRANCH . ' as t1');
$this->db->join('' . STAFF . ' as t2', 't2.StaffID = t1.StaffID', 'LEFT');
// not for SuperAdmin and Student Role code
$this->db->where_not_in('t1.StaffID', $staffId);
$this->db->group_by('t1.StaffID');
// $this->db->group_by('t1.StaffID');
$this->db->where('t1.BranchCode', $loginUserBranchId);
$this->db->where('t1.ListCode', EMPLOYEE)->or_where("t1.ListCode",TRAINEE);
// $this->db->where('t2.ListCode', EMPLOYEE)->or_where("t1.ListCode",TRAINEE);
$this->db->order_by('t1.CreatedOn', 'DESC');
// print_r($this->db->last_query());die();
$empDetails = $this->db->get();
$checkArr = $empDetails->result();
if (count($checkArr) > 0) {