employee list changes for super admin : kdk

This commit is contained in:
dineshkumarkannan 2018-04-24 10:00:25 +05:30
parent ecabc61026
commit 2f5b8230fe

View File

@ -164,6 +164,7 @@ class Employee_model extends CI_Model
// echo $loginUserId, $loginUserBranchId, $loginUserType; exit();
if ($loginUserType == SUPER_ADMIN) {
// list for super admin
// echo $loginUserBranchId;exit();
if ($loginUserBranchId == 'All') {
// for getting all branch details
$staffId = $this->selfGetEmpId($loginUserId);
@ -187,16 +188,16 @@ class Employee_model extends CI_Model
} else {
$staffId = $this->selfGetEmpId($loginUserId);
$this->db->select('t2.*');
$this->db->from('' . STAFF_BRANCH . ' as t1');
$this->db->join('' . STAFF . ' as t2', 't2.StaffID = t1.StaffID', 'LEFT');
$this->db->from('' . STAFF_BRANCH . ' as t1');
// not for SuperAdmin and Student Role code
$this->db->where_not_in('t1.StaffID', $staffId);
$this->db->group_by('t1.StaffID');
$this->db->where('t1.BranchCode', $loginUserBranchId);
$this->db->where('t1.ListCode', EMPLOYEE);
$this->db->order_by('t1.CreatedOn', 'DESC');
$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->where('t1.BranchCode', $loginUserBranchId);
// $this->db->where('t1.ListCode', EMPLOYEE);
$this->db->order_by('t1.CreatedOn', 'DESC');
$empDetails = $this->db->get();
$checkArr = $empDetails->result();
if (count($checkArr) > 0) {