diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 5ee92000..3340a0e1 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1303,12 +1303,12 @@ public function filterSalesPDList_post() { $key = 'tmp/'. $pd_master_data[0]['modified_fname']; $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$key,'+5 minutes'); //echo $singed_uri; - $sucess = file_put_contents($filename, $singed_uri); + $sucess = file_put_contents($filename, file_get_contents($singed_uri)); //echo '*'.$sucess; } // die(); //get exact data - $cur_section_data = readexceldata::getExcelSectionData($filename,(isset($records['form_id']) ? $records['form_id'] : null),$records['pd_id']); + $cur_section_data = readexceldata::getExcelSectionData($filename,(isset($records['form_id']) && $records['form_id'] ? $records['form_id'] : null),$records['pd_id']); if(count($cur_section_data)) { $data['dataStatus'] = true; diff --git a/api/application/helpers/readexceldata_helper.php b/api/application/helpers/readexceldata_helper.php index af34dd91..2fa425ff 100644 --- a/api/application/helpers/readexceldata_helper.php +++ b/api/application/helpers/readexceldata_helper.php @@ -7,8 +7,9 @@ class readexceldata { $CI =&get_instance(); $CI->load->library('myspreadsheet'); - - // echo $file_path_withname;echo file_exists($file_path_withname); die(); + // echo is_numeric($section_id); + // var_dump($section_id);die(); + //echo $file_path_withname;echo file_exists($file_path_withname); die(); // $file_path_withname = 'C:/xampp/htdocs/ssa_external_data/testing/tmp/mySMCPD.xlsx'; // $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($inputFileName); $spreadsheet_io_fact = $CI->myspreadsheet->getIOFactory($file_path_withname); @@ -36,19 +37,20 @@ class readexceldata static function seperateSectionData($section_id,$sheetData,$pd_id) { - //echo 'worked';die(); + // echo 's-worked';die(); $CI =&get_instance(); $CI->load->model('PD_Model'); $where_condition_array = array('isactive' => 1,'section_id' => $section_id); //if($section_id == null){ $where_condition_array = array('isactive' => 1,'section_id in ' => '(null,1)'); } $section_ref_data = $CI->PD_Model->selectCustomRecords(array('*'),$where_condition_array,EXCEL_COLUMN_REF_NAME); - //print_r($section_ref_data);die(); + // print_r($section_ref_data);die(); $return_data = array(); switch($section_id) { case is_numeric($section_id): - $return_data = SELF::getBorrowerSectionData($sheetData,$section_ref_data); + + $return_data = SELF::getIndividualSectionData($sheetData,$section_ref_data); if($section_id == 2) //get pd initialted address as custom function { @@ -66,6 +68,7 @@ class readexceldata break; default: + $return_data = SELF::getTriggerData($sheetData,$section_ref_data); } @@ -74,7 +77,7 @@ class readexceldata } - static function getBorrowerSectionData($sheetData,$section_ref_data) + static function getIndividualSectionData($sheetData,$section_ref_data) { //$start_letter = 'B';$i = 1; $return_data = array(); @@ -112,11 +115,12 @@ class readexceldata } static function getTriggerData($sheetData,$section_ref_data) { + // echo 'worked';die(); $return_data = array(); unset($sheetData[1]); foreach ($sheetData as $key => $value) { - // print_r($value['C']);die(); + // print_r($value);//die(); $tmp = SELF::returnMatchedData($section_ref_data,$value); if(is_array($tmp) && isset($tmp['key_name'])) { diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 5091a7a7..d021ced0 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -13,7 +13,7 @@ class PD_Model extends SPARQ_Model { public function listLessPDDetails($page,$limit,$sort,$pdofficerid,$datetype,$fdate,$tdate,$lenderid,$status,$lender_details,$pdagencyid,$vendor_pdofficer,$user_type)// $page represents mysql offset { - //echo $pd_agency_id;die(); + //\echo $pd_agency_id;die(); $this->db->SELECT('PDTRIGGER.pd_id,PDTRIGGER.imgc_fin_institute,PDTRIGGER.pd_sno,PDTRIGGER.fk_lender_id,PDTRIGGER.sub_entity_id,SUBENTITY.short_name as sub_entity_short_name,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name,PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name, PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PRODUCTS.prod_catagory,PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %H:%i:%s") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i:%s") as master_updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.full_name as agency_name,AGENCY.short_name as agency_short_name,AGENCY.is_qc_enabled, PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDTRIGGER.other_pincode,PDAPPLICANTSDETAILS.applicant_name,PDTRIGGER.is_otp_done,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id,PDTRIGGER.encrypted_url,PDTRIGGER.random_string,PDTRIGGER.pd_qc_note,ENTITY.is_sms_enabled,ENTITY.is_mail_enabled,ENTITY.is_app_notify_enabled,PDTRIGGER.is_notify_enabled,(SELECT DATE_FORMAT(createdon,"%d/%m/%Y") FROM h_common_masters where PDTRIGGER.pd_id = primary_key AND field_name = "pd_status" order by log_id DESC limit 1) as updatedon,ENTITYFININSTITUTION.institute_name as fin_institute_name,PDTRIGGER.is_video_merged,PDTRIGGER.vendor_status'); //$this->db->SELECT('pd_sno,fk_lender_id,pd_agency_id,pd_status,vendor_status'); $this->db->FROM(PDTRIGGER.' as PDTRIGGER'); @@ -60,7 +60,7 @@ class PD_Model extends SPARQ_Model { if($lenderid != "" || $lenderid != null) { - //$this->db->WHERE('PDTRIGGER.fk_createdby',$lenderid); + $this->db->WHERE('PDTRIGGER.fk_lender_id',$lenderid); //print_r($lender_details);die(); if(isset($lender_details['entity'])) { @@ -149,6 +149,7 @@ class PD_Model extends SPARQ_Model { $this->db->ORDER_BY('PDTRIGGER.pd_id',$sort); //$this->db->LIMIT($limit,$page); $result_array = $this->db->GET()->result_array(); + // print_r($this->db->last_query());die(); if(count($result_array) != 0) {