From 27ef449cf3613cba1d1881dbcd721bed3694731c Mon Sep 17 00:00:00 2001 From: Sanjeev Date: Thu, 20 May 2021 11:54:27 +0530 Subject: [PATCH] date_type : ps --- api/application/controllers/PD_Controller.php | 3 ++- api/application/models/PD_Model.php | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index e5a8afb9..7dd606a9 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -2211,6 +2211,7 @@ public function assignPDTempalate($data) $vendor_pdofficer = isset($records['vendor_pdofficer']) ? $records['vendor_pdofficer'] : null; $user_type = isset($records['user_type']) ? $records['user_type'] : null; $createdby = $records['createdby']; + $date_type = isset($records['date_type']) ? $records['date_type'] : null; $lender_details = array(); //if lender id exists, then make custom filter for only SMC usage @@ -2240,7 +2241,7 @@ public function assignPDTempalate($data) } - $result_data = $this->PD_Model->PDListwithGlobalFilters($pd_type,$pd_status,$pd_from_date,$pd_to_date,$pd_city,$pd_products,$pd_lender,$pd_applicant_name,$pd_applicant_lender_ref,$pd_officer_name,$include_archive,$pd_officer_id,$pd_agency_id,$vendor_pdofficer,$user_type,$createdby); + $result_data = $this->PD_Model->PDListwithGlobalFilters($pd_type,$pd_status,$pd_from_date,$pd_to_date,$pd_city,$pd_products,$pd_lender,$pd_applicant_name,$pd_applicant_lender_ref,$pd_officer_name,$include_archive,$pd_officer_id,$pd_agency_id,$vendor_pdofficer,$user_type,$createdby,$date_type); if(count($result_data)) { diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 156a6536..0c30491d 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -203,7 +203,7 @@ class PD_Model extends SPARQ_Model { //PD List with Common Filters - public function PDListwithGlobalFilters($pd_type,$pd_status,$pd_from_date,$pd_to_date,$pd_city,$pd_products,$pd_lender,$pd_applicant_name,$pd_applicant_lender_ref,$pd_officer_name,$include_archive,$pd_officer_id,$pd_agency_id,$vendor_pdofficer,$user_type,$createdby) + public function PDListwithGlobalFilters($pd_type,$pd_status,$pd_from_date,$pd_to_date,$pd_city,$pd_products,$pd_lender,$pd_applicant_name,$pd_applicant_lender_ref,$pd_officer_name,$include_archive,$pd_officer_id,$pd_agency_id,$vendor_pdofficer,$user_type,$createdby,$date_type) { $limit = 1000; @@ -261,7 +261,12 @@ class PD_Model extends SPARQ_Model { } if(($pd_from_date != "" || $pd_from_date != null) && ($pd_to_date != "" || $pd_to_date != null)) { - $this->db->where('PDTRIGGER.pd_date_of_initiation BETWEEN ' ."'$pd_from_date'". ' AND ' ."'$pd_to_date'"); + // $this->db->where('PDTRIGGER.pd_date_of_initiation BETWEEN ' ."'$pd_from_date'". ' AND ' ."'$pd_to_date'"); + if((!empty($date_type)) && ($date_type == 2)){ + $this->db->where('PDTRIGGER.completed_on BETWEEN ' ."'$pd_from_date'". ' AND ' ."'$pd_to_date'"); + }else{ + $this->db->where('PDTRIGGER.pd_date_of_initiation BETWEEN ' ."'$pd_from_date'". ' AND ' ."'$pd_to_date'"); + } } if(!empty($pd_city))