diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index b67b48e7..2b0e890e 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1804,7 +1804,7 @@ public function filterSalesPDList_post() { function getCityWiseAgency_get(){ - $city_id = $this->get('city_id'); + $city_id = $this->get('city_id') ? $this->get('city_id') : ""; $Lenderlist = $this->PD_Model->getCityWiseSMCAgency($city_id); $data = (!empty($Lenderlist)) ? array('dataStatus' => true,'status' => REST_Controller::HTTP_OK,'records' => $Lenderlist) diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 84566742..a52f5f36 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -2292,7 +2292,9 @@ class PD_Model extends SPARQ_Model { $this->db->select('AGENCYLIST.agency_id as entity_id, AGENCYLIST.agency_name as full_name, AGENCYLIST.agency_abbr as short_name,AGENCYLIST.fk_city_id'); $this->db->from(AGENCYLIST.' as AGENCYLIST'); $this->db->where('AGENCYLIST.isactive',1); + if($city!=""){ $this->db->like('AGENCYLIST.fk_city_id',"'".$city."'"); + } $result = $this->db->get()->result_array(); return $result;