From e49ca673864bf1ea94292edd65c0b68a2c9c96d3 Mon Sep 17 00:00:00 2001 From: sanjeev Date: Wed, 24 Nov 2021 18:09:15 +0530 Subject: [PATCH] review changes : ps --- .../controllers/SMC_Credit_PD_Controller.php | 2 +- api/application/models/PD_Model.php | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 7615b2ea..b67b48e7 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1805,7 +1805,7 @@ public function filterSalesPDList_post() { function getCityWiseAgency_get(){ $city_id = $this->get('city_id'); - $Lenderlist = $this->PD_Model->getSMCCityWiseLender($city_id); + $Lenderlist = $this->PD_Model->getCityWiseSMCAgency($city_id); $data = (!empty($Lenderlist)) ? array('dataStatus' => true,'status' => REST_Controller::HTTP_OK,'records' => $Lenderlist) : array('dataStatus' => false,'status' => REST_Controller::HTTP_NOT_FOUND,'msg' =>'No Records Found!'); diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 5b5bb0b3..ea16ea02 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -2277,14 +2277,12 @@ class PD_Model extends SPARQ_Model { //Get SMC CityWise Agency - function getCityWiseAgency($city){ - $this->db->select('AGENCYLIST.agent_id as entity_id, AGENCYLIST.agent_name as full_name, AGENCYLIST.agent_abbr as short_name,AGENCYCITYMAP.fk_city_id'); + function getCityWiseSMCAgency($city){ + $this->db->select('AGENCYLIST.agent_id as entity_id, AGENCYLIST.agent_name as full_name, AGENCYLIST.agent_abbr as short_name,AGENCYLIST.fk_city_id'); $this->db->from(AGENCYLIST.' as AGENCYLIST'); - $this->db->join(AGENCYCITYMAP.' as AGENCYCITYMAP','AGENCYCITYMAP.fk_agent_id = AGENCYLIST.agent_id and AGENCYCITYMAP.isactive = 1','LEFT'); $this->db->where('AGENCYLIST.isactive',1); - $this->db->like('AGENCYCITYMAP.fk_city_id',"'".$city."'"); + $this->db->like('AGENCYLIST.fk_city_id',"'".$city."'"); $result = $this->db->get()->result_array(); - //print_r($this->db->last_query());die(); return $result; } @@ -2300,7 +2298,7 @@ class PD_Model extends SPARQ_Model { $this->db->join(ROLES.' as ROLES','ROLES.role_id = USERPROFILEROLES.user_role and ROLES.isactive = 1','LEFT'); $this->db->where('USERPROFILE.isactive',1); $this->db->where_in('USERPROFILEROLES.user_role',$role); - if(!empty($entity)){ $this->db->where('USERPROFILE.fk_entity_id',$entity); } + // if(!empty($entity)){ $this->db->where('USERPROFILE.fk_entity_id',$entity); } $result = $this->db->get()->result_array(); // print_r($this->db->last_query());die(); return $result;