From 72a67b88f6283a4975851662387cdd635d225f81 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Thu, 8 Nov 2018 21:59:05 +0530 Subject: [PATCH] Dashboard Alert Details : ps --- api/application/config/routes.php | 1 + .../controllers/Dash_Board_Controller.php | 10 ++++++++++ api/application/models/Dash_Board_Model.php | 19 +++++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/api/application/config/routes.php b/api/application/config/routes.php index 21459c20..a227bc4e 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -159,5 +159,6 @@ $route['savePDFormDetails'] = 'PD_Controller/savePDFormDetails'; $route['getDashBoardMaster'] = 'Dash_Board_Controller/getDashBoardDetailsOfPDTypeAndPDStatusWithDayWeekMonth'; $route['getDashBoardLenderCity'] = 'Dash_Board_Controller/getDashBoardDetailsOfLenderAndCitywise'; $route['getDashBoardDetailsOfCity'] = 'Dash_Board_Controller/getDashBoardDetailsOfCitywise'; +$route['getDashBoardAlertDetails'] = 'Dash_Board_Controller/getDashBoardDetailsOfAlert'; diff --git a/api/application/controllers/Dash_Board_Controller.php b/api/application/controllers/Dash_Board_Controller.php index 00093c57..ca4d2d25 100644 --- a/api/application/controllers/Dash_Board_Controller.php +++ b/api/application/controllers/Dash_Board_Controller.php @@ -50,5 +50,15 @@ class Dash_Board_Controller extends REST_Controller { $data['records'] = $res; $this->response($data,REST_Controller::HTTP_OK); } + public function getDashBoardDetailsOfAlert_get(){ + + $res = $this->Dash_Board_Model->getDashBoardDetailsOfAlert(); + + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['records'] = $res; + $this->response($data,REST_Controller::HTTP_OK); + + } } \ No newline at end of file diff --git a/api/application/models/Dash_Board_Model.php b/api/application/models/Dash_Board_Model.php index 26807d84..1e2211de 100644 --- a/api/application/models/Dash_Board_Model.php +++ b/api/application/models/Dash_Board_Model.php @@ -72,6 +72,25 @@ class Dash_Board_Model extends SPARQ_Model { $result_data['current_month'] = $this->db->query($sql_query_current_month)->result_array(); return $result_data; } + + public function getDashBoardDetailsOfAlert(){ + + $this->db->select('PDTRIGGER.lender_applicant_id, + PDTRIGGER.pd_status, + PDTRIGGER.fk_lender_id, + PDTRIGGER.pd_id, + ENTITY.full_name as entity_name, + COAPPLICANTSDETAILS.applicant_name as applicant_name'); + $this->db->from('t_pd_triggered PDTRIGGER'); + $this->db->join('m_entity ENTITY', 'PDTRIGGER.fk_lender_id = ENTITY.entity_id','left'); + $this->db->join('t_pd_co_applicants_details COAPPLICANTSDETAILS', 'PDTRIGGER.pd_id = COAPPLICANTSDETAILS.fk_pd_id and COAPPLICANTSDETAILS.applicant_type = 1','left'); + $this->db->where('PDTRIGGER.pd_status = "TRIGGERED"'); + $this->db->or_where('PDTRIGGER.pd_status = "ALLOCATED"'); + + $query = $this->db->get(); + + return $query->result(); + } } \ No newline at end of file