Pd Purge Fixes 2 : ps

This commit is contained in:
VE10-Sanjeev 2022-10-27 17:50:39 +05:30
parent b3f4490f40
commit 6e25152dd8

View File

@ -575,6 +575,8 @@ class Data_Dump_Controller extends REST_Controller
$from_date = $this->get('from_date'); $from_date = $this->get('from_date');
$to_date = $this->get('to_date'); $to_date = $this->get('to_date');
$pdid_arr = array(); // testing purpose $pdid_arr = array(); // testing purpose
$msg = '';
$columns = array('PDTRIGGER.pd_id', 'PDTRIGGER.addressline1', 'PDTRIGGER.addressline2', 'PDTRIGGER.addressline3', 'PDTRIGGER.pd_contact_mobileno', 'PDTRIGGER.pd_contact_landline', 'PDTRIGGER.pd_sno', 'DATE_FORMAT(PDTRIGGER.createdon, "%d/%m/%Y") as createdon', 'PDAPPLICANTSDETAILS.pd_co_applicant_id', 'PDTRIGGER.pd_contact_person_mail', 'PDTRIGGER.fk_lender_id'); $columns = array('PDTRIGGER.pd_id', 'PDTRIGGER.addressline1', 'PDTRIGGER.addressline2', 'PDTRIGGER.addressline3', 'PDTRIGGER.pd_contact_mobileno', 'PDTRIGGER.pd_contact_landline', 'PDTRIGGER.pd_sno', 'DATE_FORMAT(PDTRIGGER.createdon, "%d/%m/%Y") as createdon', 'PDAPPLICANTSDETAILS.pd_co_applicant_id', 'PDTRIGGER.pd_contact_person_mail', 'PDTRIGGER.fk_lender_id');
$table = PDTRIGGER . ' as PDTRIGGER'; $table = PDTRIGGER . ' as PDTRIGGER';
$joins = array(array( $joins = array(array(
@ -583,17 +585,20 @@ class Data_Dump_Controller extends REST_Controller
'jointype' => 'LEFT' 'jointype' => 'LEFT'
)); ));
if (!empty($pdsno)) { if (!empty($pdsno)) {
log_message('ERROR', "PD Serial No => " . $pdsno); $msg = "PD Serial No => " . $pdsno;
log_message('ERROR', $msg);
$tgr_cond_arr = array('PDTRIGGER.pd_status' => QC_COMPLETED, 'PDTRIGGER.pd_sno' => $pdsno); $tgr_cond_arr = array('PDTRIGGER.pd_status' => QC_COMPLETED, 'PDTRIGGER.pd_sno' => $pdsno);
}else if(($from_date != "" || $from_date != null) && ($to_date != "" || $to_date != null)){ }else if(($from_date != "" || $from_date != null) && ($to_date != "" || $to_date != null)){
$newDate1 = date("Y-m-d", strtotime($from_date)); $newDate1 = date("Y-m-d", strtotime($from_date));
$newDate2 = date("Y-m-d", strtotime($to_date)); $newDate2 = date("Y-m-d", strtotime($to_date));
log_message('ERROR', "PD Date Given Format => " . $from_date ." to ".$to_date." Changed ".$newDate1." to ".$newDate2); $msg = "PD Created Date Given Format => " . $from_date ." to ".$to_date;
log_message('ERROR', $msg." Changed ".$newDate1." to ".$newDate2);
$where = 'DATE(PDTRIGGER.createdon) BETWEEN ' ."'$newDate1'". ' AND ' ."'$newDate2'"; $where = 'DATE(PDTRIGGER.createdon) BETWEEN ' ."'$newDate1'". ' AND ' ."'$newDate2'";
$tgr_cond_arr = array('PDTRIGGER.pd_status' => QC_COMPLETED, $where => null); $tgr_cond_arr = array('PDTRIGGER.pd_status' => QC_COMPLETED, $where => null);
} }
else{ else{
log_message('ERROR', "90th date => " . $_90th_date); $msg = "90th date => " . $_90th_date;
log_message('ERROR', $msg);
$tgr_cond_arr = array('PDTRIGGER.pd_status' => QC_COMPLETED, 'DATE_FORMAT(PDTRIGGER.createdon, "%d/%m/%Y") <=' => $_90th_date); $tgr_cond_arr = array('PDTRIGGER.pd_status' => QC_COMPLETED, 'DATE_FORMAT(PDTRIGGER.createdon, "%d/%m/%Y") <=' => $_90th_date);
} }
@ -657,16 +662,20 @@ class Data_Dump_Controller extends REST_Controller
// if(!empty($return)){ // if(!empty($return)){
// array_push($pdid_arr['updated pdid'],$return); // array_push($pdid_arr['updated pdid'],$return);
// array_push($pdid_arr['data'],$earliest);} // array_push($pdid_arr['data'],$earliest);}
array_push($pdid_arr,$pdid);
} }
// array_push($img_response, $pdid);
$data['dataStatus'] = true; $data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK; $data['records'] = $pdid_arr;
$data['earliest'] = $earliest; $data['message'] = $msg;
// $data['totalDetailsInCount'] =count($tgr_dtls); // $data['earliest'] = $earliest;
$data['totalDetailsInCount'] =count($tgr_dtls);
// $data['before 90 days data'] = $tgr_dtls; // $data['before 90 days data'] = $tgr_dtls;
}else{ }else{
$data['dataStatus'] = false; $data['dataStatus'] = false;
$data['status'] = REST_Controller::HTTP_OK; $data['message'] = 'There is no data in QC-Completed '.$msg;
$data['totalDetailsInCount'] = count($tgr_dtls);
} }
$this->response($data, REST_Controller::HTTP_OK); $this->response($data, REST_Controller::HTTP_OK);
} }
@ -868,7 +877,7 @@ class Data_Dump_Controller extends REST_Controller
break; break;
case 6: case 6:
// 6 residence_place // 6 residence_place
$arr6 = array('residence_place', 'earning_name_of_the_employer_or_business', 'family_member_name'); $arr6 = array('residence_place', 'earning_name_of_the_employer_or_business', 'family_member_name','ownershipOther');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr6, $general_format); $replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr6, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr6, $general_format); $replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr6, $general_format);
break; break;
@ -880,7 +889,7 @@ class Data_Dump_Controller extends REST_Controller
break; break;
case 8: case 8:
// 8 label // 8 label
$arr8 = array('label'); $arr8 = array('label','others_loan_taken');
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr8, $general_format); $replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr8, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr8, $general_format); $replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr8, $general_format);
break; break;
@ -902,7 +911,7 @@ class Data_Dump_Controller extends REST_Controller
break; break;
case 13: case 13:
// 13 partner_name_master . gst_Regn_cert_pic , shop_eat_act_cert_pic,family_member_name // 13 partner_name_master . gst_Regn_cert_pic , shop_eat_act_cert_pic,family_member_name
$arr13 = array("partner_name_master", "gst_Regn_cert_pic", "shop_eat_act_cert_pic", "export_import_cert_pic", "factory_cert_pic", "pf_regn_pic", "esic_regn_pic", "eb_bill_pic","family_member_name"); $arr13 = array("partner_name_master", "gst_Regn_cert_pic", "shop_eat_act_cert_pic", "export_import_cert_pic", "factory_cert_pic", "pf_regn_pic", "esic_regn_pic", "eb_bill_pic","family_member_name","partner_other_name");
$replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr13, $general_format); $replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr13, $general_format);
$replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr13, $general_format); $replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr13, $general_format);
break; break;