From 6e25152dd8c4e4e70394be3d2515a7d190774967 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Thu, 27 Oct 2022 17:50:39 +0530 Subject: [PATCH] Pd Purge Fixes 2 : ps --- .../controllers/Data_Dump_Controller.php | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/api/application/controllers/Data_Dump_Controller.php b/api/application/controllers/Data_Dump_Controller.php index a157c3b0..a944b625 100644 --- a/api/application/controllers/Data_Dump_Controller.php +++ b/api/application/controllers/Data_Dump_Controller.php @@ -575,6 +575,8 @@ class Data_Dump_Controller extends REST_Controller $from_date = $this->get('from_date'); $to_date = $this->get('to_date'); $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'); $table = PDTRIGGER . ' as PDTRIGGER'; $joins = array(array( @@ -583,17 +585,20 @@ class Data_Dump_Controller extends REST_Controller 'jointype' => 'LEFT' )); 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); }else if(($from_date != "" || $from_date != null) && ($to_date != "" || $to_date != null)){ $newDate1 = date("Y-m-d", strtotime($from_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'"; $tgr_cond_arr = array('PDTRIGGER.pd_status' => QC_COMPLETED, $where => null); } 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); } @@ -657,16 +662,20 @@ class Data_Dump_Controller extends REST_Controller // 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['status'] = REST_Controller::HTTP_OK; - $data['earliest'] = $earliest; - // $data['totalDetailsInCount'] =count($tgr_dtls); + $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; - $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); } @@ -868,7 +877,7 @@ class Data_Dump_Controller extends REST_Controller break; case 6: // 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_j_arr = $this->traverseArray($replaced_j_arr, $arr6, $general_format); break; @@ -880,7 +889,7 @@ class Data_Dump_Controller extends REST_Controller break; case 8: // 8 label - $arr8 = array('label'); + $arr8 = array('label','others_loan_taken'); $replaced_pj_arr = $this->traverseArray($replaced_pj_arr, $arr8, $general_format); $replaced_j_arr = $this->traverseArray($replaced_j_arr, $arr8, $general_format); break; @@ -902,7 +911,7 @@ class Data_Dump_Controller extends REST_Controller break; case 13: // 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_j_arr = $this->traverseArray($replaced_j_arr, $arr13, $general_format); break;