From 537d0e4d3276ac269f3a397aa74e9bc4d82ff389 Mon Sep 17 00:00:00 2001 From: rajasekar Date: Thu, 21 Mar 2019 13:32:44 +0530 Subject: [PATCH] 1464 emp list --- Apollo/api/application/models/Employee_model.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Apollo/api/application/models/Employee_model.php b/Apollo/api/application/models/Employee_model.php index 892efb82..d4771e57 100755 --- a/Apollo/api/application/models/Employee_model.php +++ b/Apollo/api/application/models/Employee_model.php @@ -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) {