From b9a1102b97e61d5a65d46a9ca033092ee079c331 Mon Sep 17 00:00:00 2001 From: Sanjeev Date: Fri, 21 May 2021 14:43:56 +0530 Subject: [PATCH] datetype changes : ps --- api/application/controllers/PD_Controller.php | 5 ++++- api/application/models/PD_Model.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index afa799e4..9d13ab81 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -2212,7 +2212,10 @@ 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; + // echo "B4 date_type ".$records['date_type']." and my return type is ".gettype($records['date_type'])."\n"; + $date_type = isset($records['date_type']) ? (int)$records['date_type'] : null; + // echo "After date_type ".$date_type." and my return type is ".gettype($date_type)."\n"; + $lender_details = array(); //if lender id exists, then make custom filter for only SMC usage diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index cb057db1..f7c8f49b 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -265,7 +265,7 @@ class PD_Model extends SPARQ_Model { // echo " now in model I have ".$pd_from_date." and my return type is ".gettype($pd_from_date)."\n"; // echo " now in model I have ".$pd_to_date." and my return type is ".gettype($pd_to_date)."\n"; // $this->db->where('PDTRIGGER.pd_date_of_initiation BETWEEN ' ."'$pd_from_date'". ' AND ' ."'$pd_to_date'"); - if((!empty($date_type)) && ($date_type == "2")){ + 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'");