From 1b92c493634e073fb61227961a7a198972a99265 Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Sat, 7 Dec 2019 19:38:59 +0530 Subject: [PATCH] LIVE ALLOCATED CASE COLLAPSE ISSUE RESOLVED --- api/application/controllers/PD_Controller.php | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 052e1cbf..91157ab2 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -1869,13 +1869,16 @@ public function assignPDTempalate($data) */ public function listLessPDDetails_get() { + + //check empty query params + $this->checkEmptyQueryParams($_GET); $page = 0;$limit = 1000;$sort = 'DESC';$pdofficerid = "";$datetype = "";$fdate ="";$tdate =""; $lenderid = "";$status="";$lender_details = array(); if($this->get('page')) { $page = $this->get('page'); } if($this->get('limit')){ $limit = $this->get('limit'); } if($this->get('sort')) { $sort = $this->get('sort'); } if($this->get('pdofficerid')) { $pdofficerid = $this->get('pdofficerid'); } - if($this->get('lenderid')) + if($this->get('lenderid')) { $lenderid = $this->get('lenderid'); $lender_details = $this->getLenderHierarchyForPDListing($lenderid); @@ -1886,7 +1889,6 @@ public function assignPDTempalate($data) if($this->get('fdate')) { $fdate = $this->get('fdate'); } if($this->get('tdate')) { $tdate = $this->get('tdate'); } if($this->get('status')) { $status = $this->get('status'); } - $result_data = $this->PD_Model->listLessPDDetails($page,$limit,$sort,$pdofficerid,$datetype,$fdate,$tdate,$lenderid,$status,$lender_details); if($result_data['data_status'] == true) @@ -1905,6 +1907,25 @@ public function assignPDTempalate($data) } + + function checkEmptyQueryParams($arr) + { + if(count($arr)) + { + foreach ($arr as $key => $value) + { + if(!$value) + { + + //exit('CATUTION'); + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_UNPROCESSABLE_ENTITY; + $data['msg'] = 'Unprocessable Params'; + $this->response($data,REST_Controller::HTTP_OK); + } + } + } + } // PD listing based on lender role hierarchy function getLenderHierarchyForPDListing($lender_user_id) {