diff --git a/api/application/controllers/Entity_Management_Controller.php b/api/application/controllers/Entity_Management_Controller.php index df47e886..07876017 100644 --- a/api/application/controllers/Entity_Management_Controller.php +++ b/api/application/controllers/Entity_Management_Controller.php @@ -579,16 +579,12 @@ class Entity_Management_Controller extends REST_Controller { $entity_city_details = $this->Entity_Management_Model->getJoinRecords($columns,$table,$joins,$where_condition_array); //print_r($entity_city_details); - if(count($entity_city_details)) - { - foreach($entity_city_details as $key => $value) - { + $fields = array('entity_lender_branch_id', 'branch_name','isactive','fk_createdby','fk_entity_id','fk_updatedby','fk_city_id'); - $where_condition_array = array('fk_entity_id' => $entity_id,'isactive'=>1,'fk_city_id' => $value['fk_city_id']); + $where_condition_array = array('fk_entity_id' => $entity_id,'isactive'=>1); $records = $this->Entity_Management_Model->selectCustomRecords($fields,$where_condition_array,ENTITYLENDERBRANCH); - $entity_city_details[$key]['branch_details'] = $records; - } - } + + @@ -596,7 +592,7 @@ class Entity_Management_Controller extends REST_Controller { { $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; - $data['records'] = $entity_city_details; + $data['records'] = array('branch_details' => $records,'city_master' =>$entity_city_details); $this->response($data,REST_Controller::HTTP_OK); } else