From aedb19da24c575a43ac299ee87ef2579c275698c Mon Sep 17 00:00:00 2001 From: sanjeev Date: Fri, 28 Jan 2022 15:50:51 +0530 Subject: [PATCH] Nation sales role : ps --- api/application/controllers/Sales_PD_Controller.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php index 67ab3023..ccb45815 100644 --- a/api/application/controllers/Sales_PD_Controller.php +++ b/api/application/controllers/Sales_PD_Controller.php @@ -313,7 +313,10 @@ class Sales_PD_Controller extends REST_Controller { // print_r ($where_condition_array); // ----END OF FILTERING THE LAST 10 DAYS RECORDS--- - + $MWISELender = (ENVIRONMENT == 'production' ? 7 : 35); + if($role && is_numeric($role) && $role == 11 && $MWISELender == $lender_id){ + // $where_condition_array['SALES_PD_DATA.product_id'] = (ENVIRONMENT == 'production' ? 23 : 22); + }else{ if($role && is_numeric($role) && $role == 15) //if role area sales head the pull all meq cases { $where_condition_array['SALES_PD_DATA.product_id'] = (ENVIRONMENT == 'production' ? 23 : 22); @@ -323,7 +326,7 @@ class Sales_PD_Controller extends REST_Controller { { $where_condition_array['SALES_PD_DATA.createdby'] = $user_id; } - + } $order_by = 'SALES_PD_DATA.sales_pd_id'; $sales_pd_data = $this->Sales_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array,$order_by,'DESC','',$or_where); @@ -334,6 +337,7 @@ class Sales_PD_Controller extends REST_Controller { $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; $data['records'] = $sales_pd_data; + $data['c'] =count($sales_pd_data); $this->response($data,REST_Controller::HTTP_OK); } else