From 88c3a64950ec430c6ab4bdd7955e129c4800c6dc Mon Sep 17 00:00:00 2001 From: "sanjeev.p" Date: Mon, 20 Sep 2021 10:41:44 +0530 Subject: [PATCH] smc new changes : ps --- .../helpers/readexceldata_helper.php | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/api/application/helpers/readexceldata_helper.php b/api/application/helpers/readexceldata_helper.php index 9b4545da..35907f8f 100644 --- a/api/application/helpers/readexceldata_helper.php +++ b/api/application/helpers/readexceldata_helper.php @@ -83,8 +83,7 @@ class readexceldata $pd_address = $CI->PD_Model->getPDAddress($pd_id); if(count($pd_address)){ $return_data['initiated_address'] = $pd_address[0]['addressline1'].', '.$pd_address[0]['city_name'].', '.$pd_address[0]['state_name'].' - '.$pd_address[0]['pincode']; } } - - + } if($section_id == 3) //get sub product as custom func tion { @@ -203,9 +202,6 @@ class readexceldata $keys = array(); foreach ($sheetData as $key => $value) { - // print_r($value); - - // die(); $tmp = SELF::returnMatchedData($section_ref_data,$value);//print_r($tmp); if(is_array($tmp)) { @@ -396,8 +392,11 @@ class readexceldata $final_data = array(); $keys_to_be_decimal = array('sales_revenue','net_profit'); $keys_to_be_per = array('share_holding'); - // print_r($return_data); - // print_r($keys);die(); + if(isset($return_data['borrower_details'])){ + $array2 = array_filter($return_data['borrower_details']['numbers_of_years_business_running'], function($a) {return $a !== 'NA';}); + $array1 = array_filter($return_data['borrower_details']['numbers_of_years_applicant_in_business'], function($a) {return $a !== 'NA';}); + $return_data['borrower_details']['numbers_of_years_applicant_in_business'] = array_replace_recursive($array1, $array2); + } foreach ($keys as $current_key => $arr) { @@ -520,5 +519,18 @@ class readexceldata } return $company; } + +// public static function change_key( $array, $old_key, $new_key) { +// echo "line at 545"; +// // print_r($array); +// if( ! array_key_exists( $old_key, $array[0] ) ) +// return $array; + +// print_r(array_keys($array[0])); +// // print_r($keys);die(); +// $keys[ array_search( $old_key, $keys ) ] = $new_key; +// print_r(array_combine( $keys, $array[0] )); +// // return array_combine( $keys, $array ); +// } } ?> \ No newline at end of file