LENDER ASC ORDER
This commit is contained in:
parent
5c929baf86
commit
dac7783b3e
@ -94,7 +94,7 @@ class PD_Controller extends REST_Controller {
|
|||||||
{
|
{
|
||||||
$fields = array('entity_id','full_name','short_name');
|
$fields = array('entity_id','full_name','short_name');
|
||||||
$where_condition_array = array('isactive' => 1,'fk_entity_type_id' => 2);
|
$where_condition_array = array('isactive' => 1,'fk_entity_type_id' => 2);
|
||||||
$result_data = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,ENTITY);
|
$result_data = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,ENTITY,array(),'','full_name');
|
||||||
if(count($result_data))
|
if(count($result_data))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
class readexceldata
|
class readexceldata
|
||||||
{
|
{
|
||||||
private static $current_section_id = null;
|
private static $current_section_id = null;
|
||||||
private static $current_excel_file_id = 9999;
|
private static $current_excel_file_id = null;
|
||||||
public static function getExcelSectionData($file_path_withname,$section_id = null,$pd_id = null,$excel_file_id = null)
|
public static function getExcelSectionData($file_path_withname,$section_id = null,$pd_id = null,$excel_file_id = null)
|
||||||
{
|
{
|
||||||
$CI =&get_instance();
|
$CI =&get_instance();
|
||||||
@ -101,32 +101,35 @@ class readexceldata
|
|||||||
{
|
{
|
||||||
$return_data = SELF::getTriggerData($sheetData,$section_ref_data);
|
$return_data = SELF::getTriggerData($sheetData,$section_ref_data);
|
||||||
//store address details in temp table SMC_TEMP_ADDRESS
|
//store address details in temp table SMC_TEMP_ADDRESS
|
||||||
if(array_key_exists('address_details', $return_data))
|
if(SELF::$current_excel_file_id)
|
||||||
{
|
{
|
||||||
foreach ($return_data['address_details'] as $key => $address)
|
if(array_key_exists('address_details', $return_data))
|
||||||
{
|
{
|
||||||
$display = $address['address'].', '.$address['city'].', '.$address['state'].', '.$address['pincode'];
|
foreach ($return_data['address_details'] as $key => $address)
|
||||||
|
|
||||||
$pincode = $CI->PD_Model->selectCustomRecords(array('*'),array('pincode' => $address['pincode']),PINCODE);
|
|
||||||
$city = $CI->PD_Model->selectCustomRecords(array('*'),array('lower(name)' => strtolower($address['city'])),CITY);
|
|
||||||
// print_r($CI->db->last_query());
|
|
||||||
// $state = $CI->PD_Model->selectCustomRecords(array('*'),array('pincode' => $address['pincode']),PINCODE,1);
|
|
||||||
$fields_to_insert = array('file_id' => SELF::$current_excel_file_id,'addressline' => $address['address']);
|
|
||||||
if(is_array($pincode) && count($pincode))
|
|
||||||
{
|
|
||||||
$fields_to_insert['pincode'] = $pincode[0]['pincode_id'];
|
|
||||||
}
|
|
||||||
if(is_array($city) && count($city))
|
|
||||||
{
|
{
|
||||||
$fields_to_insert['city'] = $city[0]['city_id'];
|
$display = $address['address'].', '.$address['city'].', '.$address['state'].', '.$address['pincode'];
|
||||||
$fields_to_insert['state'] = $city[0]['fk_state_id'];
|
|
||||||
}
|
|
||||||
|
|
||||||
// print_r($fields_to_insert);
|
$pincode = $CI->PD_Model->selectCustomRecords(array('*'),array('pincode' => $address['pincode']),PINCODE);
|
||||||
$temp_add_id = $CI->PD_Model->saveRecords($fields_to_insert,SMC_TEMP_ADDRESS);
|
$city = $CI->PD_Model->selectCustomRecords(array('*'),array('lower(name)' => strtolower($address['city'])),CITY);
|
||||||
$fields_to_insert['address_id'] = $temp_add_id;
|
// print_r($CI->db->last_query());
|
||||||
$return_data['address_details'][ $key ]['display'] = $display;
|
// $state = $CI->PD_Model->selectCustomRecords(array('*'),array('pincode' => $address['pincode']),PINCODE,1);
|
||||||
$return_data['address_details'][ $key ]['id'] = $fields_to_insert;
|
$fields_to_insert = array('file_id' => SELF::$current_excel_file_id,'addressline' => $address['address']);
|
||||||
|
if(is_array($pincode) && count($pincode))
|
||||||
|
{
|
||||||
|
$fields_to_insert['pincode'] = $pincode[0]['pincode_id'];
|
||||||
|
}
|
||||||
|
if(is_array($city) && count($city))
|
||||||
|
{
|
||||||
|
$fields_to_insert['city'] = $city[0]['city_id'];
|
||||||
|
$fields_to_insert['state'] = $city[0]['fk_state_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// print_r($fields_to_insert);
|
||||||
|
$temp_add_id = $CI->PD_Model->saveRecords($fields_to_insert,SMC_TEMP_ADDRESS);
|
||||||
|
$fields_to_insert['address_id'] = $temp_add_id;
|
||||||
|
$return_data['address_details'][ $key ]['display'] = $display;
|
||||||
|
$return_data['address_details'][ $key ]['id'] = $fields_to_insert;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -276,7 +279,7 @@ class readexceldata
|
|||||||
$return_data = array();
|
$return_data = array();
|
||||||
foreach ($arr as $key => $value)
|
foreach ($arr as $key => $value)
|
||||||
{
|
{
|
||||||
if(is_string($value) || is_numeric($value))
|
if((is_string($value) && $value != '') || is_numeric($value))// && $value != '')
|
||||||
// if($value)
|
// if($value)
|
||||||
{
|
{
|
||||||
$return_data[$key] = $value;
|
$return_data[$key] = $value;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user