diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 3ceb6ce4..41c977da 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -4235,11 +4235,36 @@ class PD_Controller extends REST_Controller { public function getAssetsWithLoanFromBusiness_post() { - $pd_id = $this->post('pd_id'); + $pdid = $this->post('pd_id'); $fields = array('json','company_id'); $where_condition_array = array('isactive' => 1,'fk_form_id' =>22,'fk_pd_id' => $pdid); $assest_data = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDFORMDETAILSJSON); - print_r($assest_data); + //print_r($assest_data); + if(count($assest_data)) + { + foreach($assest_data as $key => $assest) + { + $json = json_decode($assest['json'],true); + //print_r($json); + if(array_key_exists('business_assets_details',$json)) + { + foreach($json['business_assets_details'] as $asset_key => $business_asset) + { + if(!strcmp($business_asset['business_emi'],'yes')) + { + $final_data[] = array('business_assets_mode'=>$business_asset['business_assets_mode'],'business_details'=>$business_asset['business_details']); + } + + } + } + } + } + + + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['record'] = $final_data; + $this->response($data,REST_Controller::HTTP_OK); } public function getProductsWithTypeofActivityFromBusiness_post()