diff --git a/api/application/config/routes.php b/api/application/config/routes.php index 06eaf9b8..f0b5b8d3 100755 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -326,4 +326,5 @@ $route['getRequestForDataDump'] = 'Request_DataDump_Controller/getRequestForData $route['getMasterForDataDump'] = 'Request_DataDump_Controller/getMasterForDataDump'; $route['downloadDataDump'] = 'Request_DataDump_Controller/downloadDataDump2'; -$route['getSMCVendorList'] = 'SMC_Credit_PD_Controller/getCityWiseAgency'; \ No newline at end of file +$route['getSMCVendorList'] = 'SMC_Credit_PD_Controller/getCityWiseAgency'; +$route['getSMCVendorPDOfficersList'] = 'SMC_Credit_PD_Controller/getSMCVendorPDOfficersList'; \ No newline at end of file diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index acf28d60..22fa4266 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1811,9 +1811,19 @@ public function filterSalesPDList_post() { : array('dataStatus' => false,'status' => REST_Controller::HTTP_NOT_FOUND,'msg' =>'No Records Found!'); $this->response($data,REST_Controller::HTTP_OK); - - + } + //2 roles = SMC Vendor PD officer and SMC Vendor PD manager + function getSMCVendorPDOfficersList_get(){ + + $role_id = $this->get('role_id'); + $entity_id = $this->get('fk_entity_id'); + $Lenderlist = $this->PD_Model->getSMCVendorPDOfficersList($role_id,$entity_id); + $data = (!empty($Lenderlist)) + ? array('dataStatus' => true,'status' => REST_Controller::HTTP_OK,'records' => $Lenderlist) + : array('dataStatus' => false,'status' => REST_Controller::HTTP_NOT_FOUND,'msg' =>'No Records Found!'); + + $this->response($data,REST_Controller::HTTP_OK); } } diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index d81bb48b..c27302ef 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -2289,5 +2289,21 @@ class PD_Model extends SPARQ_Model { } + function getSMCVendorPDOfficersList($role,$entity){ + if(empty($role)){ + $role = array(28,29); + } + $this->db->select('USERPROFILE.userid, concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as officer_name, USERPROFILE.email, USERPROFILE.mobile_no,USERPROFILEROLES.user_role,ROLES.role_name, ROLES.role_description'); + $this->db->from(USERPROFILE.' as USERPROFILE'); + $this->db->join(USERPROFILEROLES.' as USERPROFILEROLES','USERPROFILEROLES.fk_userid = USERPROFILE.userid and USERPROFILEROLES.isactive = 1','LEFT'); + $this->db->join(ROLES.' as ROLES','ROLES.role_id = USERPROFILEROLES.user_role and ROLES.isactive = 1','LEFT'); + $this->db->where('USERPROFILE.isactive',1); + $this->db->where_in('USERPROFILEROLES.user_role',$role); + if(!empty($entity)){ $this->db->where('USERPROFILE.fk_entity_id',$entity); } + $result = $this->db->get()->result_array(); + // print_r($this->db->last_query());die(); + return $result; + } + } \ No newline at end of file