From 2f5b8230fe72144bbcbf7463cfccc07b8e7a60bd Mon Sep 17 00:00:00 2001 From: dineshkumarkannan Date: Tue, 24 Apr 2018 10:00:25 +0530 Subject: [PATCH] employee list changes for super admin : kdk --- .../api/application/models/Employee_model.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Apollo/api/application/models/Employee_model.php b/Apollo/api/application/models/Employee_model.php index d60cf7f8..d08a72d7 100755 --- a/Apollo/api/application/models/Employee_model.php +++ b/Apollo/api/application/models/Employee_model.php @@ -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) {