DataDump : ps
This commit is contained in:
parent
d3f97a0566
commit
0ac8d8010b
@ -587,17 +587,16 @@ class Data_Dump_Controller extends REST_Controller
|
||||
|
||||
if(empty($pdsno) && empty($from_date) && empty($to_date) && empty($entity)){
|
||||
$msg = "";
|
||||
$to_get_entity_id = $this->PD_Model->selectCustomRecords(array('fk_lender_id'), array('pd_status' => QC_COMPLETED),PDTRIGGER, array(), '', '', '', 'fk_lender_id');
|
||||
print_r($this->db->last_query());
|
||||
print_r($to_get_entity_id);die();
|
||||
$to_get_entity_id = $this->PD_Model->selectCustomRecords(array('fk_lender_id'), array('pd_status' => QC_COMPLETED),PDTRIGGER, array(), '', '', '', 'fk_lender_id');
|
||||
for ($i = 0; $i < count($to_get_entity_id); $i++) {
|
||||
$entity = $to_get_entity_id[$i]['fk_lender_id'];
|
||||
$select = array('data_purge_days');
|
||||
$select = array('data_purge_days','short_name');
|
||||
$condit = array('isactive' => 1,'fk_entity_type_id'=> 2,'entity_id'=>$entity);
|
||||
$value = $this->PD_Model->selectCustomRecords($select, $condit, ENTITY);
|
||||
// print_r($value);
|
||||
if(!empty($value)){
|
||||
$days = $value[0]['data_purge_days'];
|
||||
$len_short_name = $value[0]['short_name'];
|
||||
}
|
||||
$where_arr = array('PDTRIGGER.pd_status' => QC_COMPLETED, 'PDTRIGGER.fk_lender_id' => $entity, '(SELECT
|
||||
MAX(DATE_FORMAT(logmaster.createdon, "%d/%m/%Y"))
|
||||
@ -606,10 +605,10 @@ class Data_Dump_Controller extends REST_Controller
|
||||
// 'PDTRIGGER.fk_customer_segment'=> 11 // 1 4 5 8 9 10 11
|
||||
|
||||
$result[] = $this->PD_Model->getJoinRecords($columns, $table, $joins, $where_arr);
|
||||
echo "---------------------------";
|
||||
print_r($this->db->last_query());
|
||||
// echo "---------------------------";
|
||||
// print_r($this->db->last_query());
|
||||
// print_r($result);
|
||||
$msg = $msg." PD QC-Completed Given Entity =>". $entity ." ". $days." days and lastdate ".$day_limit;
|
||||
$msg = $msg."( PD QC-Completed Given Entity =>". $len_short_name." [".$entity ."] ". $days." days and Lastdate = ".$day_limit." )";
|
||||
}
|
||||
// print_r($result);
|
||||
$tgr_dtls = array_merge(...$result);
|
||||
@ -659,67 +658,78 @@ class Data_Dump_Controller extends REST_Controller
|
||||
// print_r($tgr_dtls);die();
|
||||
|
||||
if(!empty($tgr_dtls)){
|
||||
// for ($i = 0; $i < count($tgr_dtls); $i++) {
|
||||
// $pdid = $tgr_dtls[$i]['pd_id'];
|
||||
// log_message('ERROR', "trigger details for Loop inx = " . $i . " PDID = " . $pdid);
|
||||
// $earliest['trigger_details'] = $tgr_dtls[$i];
|
||||
// if (!empty($pdid)) {
|
||||
// $apcnt_fields = array('pd_co_applicant_id', 'mobile_no', 'additional_mobile_no', 'landline', 'email', 'addressline1', 'addressline2', 'addressline3', 'company_name', 'applicant_name');
|
||||
// $apcnt_cond_arr = array('isactive' => 1, 'fk_pd_id' => $pdid);
|
||||
// $apcnt_dtls = $this->PD_Model->selectCustomRecords($apcnt_fields, $apcnt_cond_arr, PDAPPLICANTSDETAILS);
|
||||
// log_message('ERROR', "Total Applicant Details for " . $pdid . " = " . count($apcnt_dtls));
|
||||
// if (!empty($apcnt_dtls)) {
|
||||
// $earliest['applicant_details'] = $apcnt_dtls;
|
||||
// }
|
||||
// $addr_fields = array('pd_address_id', 'addressline1');
|
||||
// $addr_cond_arr = array('isactive' => 1, 'fk_pd_id' => $pdid);
|
||||
// $addr_dtls = $this->PD_Model->selectCustomRecords($addr_fields, $addr_cond_arr, PDADDRESS);
|
||||
// log_message('ERROR', "Total Address Details for " . $pdid . " = " . count($addr_dtls));
|
||||
// if (!empty($addr_dtls)) {
|
||||
// $earliest['address_details'] = $addr_dtls;
|
||||
// }
|
||||
// $json_fields = array('pd_form_detail_json_id', 'json', 'processed_json', 'fk_pd_id', 'fk_form_id');
|
||||
// $json_cond_arr = array('isactive' => 1, 'fk_pd_id' => $pdid);
|
||||
// $json_dtls = $this->PD_Model->selectCustomRecords($json_fields, $json_cond_arr, PDFORMDETAILSJSON);
|
||||
// log_message('ERROR', "Total JSON Details for " . $pdid . " = " . count($json_dtls));
|
||||
// if (!empty($json_dtls)) {
|
||||
// $earliest['json_details'] = $json_dtls;
|
||||
// }
|
||||
// $previous_json_fields = array('pd_form_detail_json_id');
|
||||
// $previous_json_cond_arr = array('isactive' => 0, 'fk_pd_id' => $pdid);
|
||||
// $previous_json_dtls = $this->PD_Model->selectCustomRecords($previous_json_fields, $previous_json_cond_arr, PDFORMDETAILSJSON);
|
||||
// log_message('ERROR', "Total IN-Active JSON Details for " . $pdid . " = " . count($previous_json_dtls));
|
||||
// if (!empty($previous_json_dtls)) {
|
||||
// foreach ($previous_json_dtls as $val) {
|
||||
// $result[] = $val['pd_form_detail_json_id'];
|
||||
// }
|
||||
// $this->db->where_in('pd_form_detail_json_id', $result);
|
||||
// $this->db->delete(PDFORMDETAILSJSON);
|
||||
// }
|
||||
for ($i = 0; $i < count($tgr_dtls); $i++) {
|
||||
$pdid = $tgr_dtls[$i]['pd_id'];
|
||||
log_message('ERROR', "trigger details for Loop inx = " . $i . " PDID = " . $pdid);
|
||||
$earliest['trigger_details'] = $tgr_dtls[$i];
|
||||
if (!empty($pdid)) {
|
||||
$apcnt_fields = array('pd_co_applicant_id', 'mobile_no', 'additional_mobile_no', 'landline', 'email', 'addressline1', 'addressline2', 'addressline3', 'company_name', 'applicant_name');
|
||||
$apcnt_cond_arr = array('isactive' => 1, 'fk_pd_id' => $pdid);
|
||||
$apcnt_dtls = $this->PD_Model->selectCustomRecords($apcnt_fields, $apcnt_cond_arr, PDAPPLICANTSDETAILS);
|
||||
log_message('ERROR', "Total Applicant Details for " . $pdid . " = " . count($apcnt_dtls));
|
||||
if (!empty($apcnt_dtls)) {
|
||||
$earliest['applicant_details'] = $apcnt_dtls;
|
||||
}
|
||||
$addr_fields = array('pd_address_id', 'addressline1');
|
||||
$addr_cond_arr = array('isactive' => 1, 'fk_pd_id' => $pdid);
|
||||
$addr_dtls = $this->PD_Model->selectCustomRecords($addr_fields, $addr_cond_arr, PDADDRESS);
|
||||
log_message('ERROR', "Total Address Details for " . $pdid . " = " . count($addr_dtls));
|
||||
if (!empty($addr_dtls)) {
|
||||
$earliest['address_details'] = $addr_dtls;
|
||||
}
|
||||
$json_fields = array('pd_form_detail_json_id', 'json', 'processed_json', 'fk_pd_id', 'fk_form_id');
|
||||
$json_cond_arr = array('isactive' => 1, 'fk_pd_id' => $pdid);
|
||||
$json_dtls = $this->PD_Model->selectCustomRecords($json_fields, $json_cond_arr, PDFORMDETAILSJSON);
|
||||
log_message('ERROR', "Total JSON Details for " . $pdid . " = " . count($json_dtls));
|
||||
if (!empty($json_dtls)) {
|
||||
$earliest['json_details'] = $json_dtls;
|
||||
}
|
||||
$previous_json_fields = array('pd_form_detail_json_id');
|
||||
$previous_json_cond_arr = array('isactive' => 0, 'fk_pd_id' => $pdid);
|
||||
$previous_json_dtls = $this->PD_Model->selectCustomRecords($previous_json_fields, $previous_json_cond_arr, PDFORMDETAILSJSON);
|
||||
$simple_array = array();
|
||||
if (!empty($previous_json_dtls)) {
|
||||
for ($i = 0; $i < count($previous_json_dtls); $i++) {
|
||||
if(gettype($previous_json_dtls[$i]) == 'array'){
|
||||
foreach($previous_json_dtls as $d){
|
||||
// $simple_array[]=$d['pd_form_detail_json_id'];
|
||||
array_push($simple_array,$d['pd_form_detail_json_id']);
|
||||
}
|
||||
}else{
|
||||
array_push($simple_array,$previous_json_dtls[$i]);
|
||||
}}
|
||||
log_message('ERROR', "Total IN-Active JSON Details for " . $pdid . " = " . count($simple_array));
|
||||
$this->db->where_in('pd_form_detail_json_id', $simple_array);
|
||||
$this->db->delete(PDFORMDETAILSJSON);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// $docs_fields = array('pd_document_id', 'pd_document_title', 'pd_document_name');
|
||||
// $docs_cond_arr = array('isactive' => 1, 'fk_pd_id' => $pdid);
|
||||
// $docs_dtls = $this->PD_Model->selectCustomRecords($docs_fields, $docs_cond_arr, PDDOCUMENTS);
|
||||
// log_message('ERROR', "Total Document Details for " . $pdid . " = " . count($docs_dtls));
|
||||
// if (!empty($docs_dtls)) {
|
||||
// $earliest['docs_details'] = $docs_dtls;
|
||||
// }
|
||||
// }
|
||||
$docs_fields = array('pd_document_id', 'pd_document_title', 'pd_document_name');
|
||||
$docs_cond_arr = array('isactive' => 1, 'fk_pd_id' => $pdid);
|
||||
$docs_dtls = $this->PD_Model->selectCustomRecords($docs_fields, $docs_cond_arr, PDDOCUMENTS);
|
||||
log_message('ERROR', "Total Document Details for " . $pdid . " = " . count($docs_dtls));
|
||||
if (!empty($docs_dtls)) {
|
||||
$earliest['docs_details'] = $docs_dtls;
|
||||
}
|
||||
}
|
||||
|
||||
// $return = $this->renamingProcess($earliest);
|
||||
$return = $this->renamingProcess($earliest);
|
||||
|
||||
// // if(!empty($return)){
|
||||
// // array_push($pdid_arr['updated pdid'],$return);
|
||||
// // array_push($pdid_arr['data'],$earliest);}
|
||||
// array_push($pdid_arr,$pdid);
|
||||
// }
|
||||
// if(!empty($return)){
|
||||
// array_push($pdid_arr['updated pdid'],$return);
|
||||
// array_push($pdid_arr['data'],$earliest);}
|
||||
array_push($pdid_arr,$pdid);
|
||||
}
|
||||
|
||||
// array_push($img_response, $pdid);
|
||||
// $data['dataStatus'] = true;
|
||||
// $data['records'] = $pdid_arr;
|
||||
// $data['message'] = $msg;
|
||||
// // $data['earliest'] = $earliest;
|
||||
// $data['totalDetailsInCount'] =count($tgr_dtls);
|
||||
$data['dataStatus'] = true;
|
||||
$data['records'] = $pdid_arr;
|
||||
$data['message'] = $msg;
|
||||
// $data['earliest'] = $earliest;
|
||||
$data['totalDetailsInCount'] =count($tgr_dtls);
|
||||
// $data['before 90 days data'] = $tgr_dtls;
|
||||
}else{
|
||||
$data['dataStatus'] = false;
|
||||
|
||||
@ -8783,10 +8783,10 @@ class PD_Controller extends REST_Controller
|
||||
if (is_array($docs_to_be_collected) && count($docs_to_be_collected)) {
|
||||
$k = 0;
|
||||
foreach ($docs_to_be_collected as $key => $value) {
|
||||
$final_data[] = array('img_key' => 'docs_to_be_collected', 'img_name' => $value['doc_name'], 'fk_form_id' => "24", "is_multiple" => 0, 'pd_image_alias_name' => "", 'is_name_editable' => 0 ,'content_type'=>(strtoupper($key) =='VIDEO' ? "2" : ((strtoupper($key) =='PDF') ? "3" : "1")));
|
||||
$final_data[$k]['img_data'] = array() ;
|
||||
$final_data[] = array('img_key' => 'docs_to_be_collected', 'img_name' => $value['doc_name'], 'fk_form_id' => "24", "is_multiple" => 0, 'pd_image_alias_name' => "", 'is_name_editable' => 0 ,'content_type'=>(strtoupper($key) =='VIDEO' ? "2" : ((strtoupper($key) =='PDF') ? "3" : "1")) ,'img_data' => array());
|
||||
$k++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//print_r($final_data);die();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user