From 99801e83b288d85ead54a9c802f4e4f40528faff Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 6 Jun 2024 08:21:33 -0400 Subject: [PATCH] empoyes fix --- app/Config/Routes.php | 2 +- app/Controllers/BkoReports.php | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 0170bd8..1095e66 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -21,7 +21,7 @@ $routes->get('/digibko/v1/loan/ready', 'BkoReports::readyApplication'); $routes->get('/digibko/v1/loan/approved', 'BkoReports::approvedApplication'); $routes->get('/digibko/v1/loan/rejected', 'BkoReports::rejectedApplication'); -$routes->get('/digibko/employers', 'BkoReports::employersList'); +$routes->get('/digibko/v1/employers', 'BkoReports::employersList'); /* * Processing the loan from back office diff --git a/app/Controllers/BkoReports.php b/app/Controllers/BkoReports.php index 0658958..15771fb 100644 --- a/app/Controllers/BkoReports.php +++ b/app/Controllers/BkoReports.php @@ -113,22 +113,21 @@ class BkoReports extends BaseController } public function employersList() :ResponseInterface { + $query = $this->db->query("SELECT uid,name FROM employer_sector"); + $employer_sector = $query->getResult('array'); - $query = $this->db->query("SELECT c.firstname, c.lastname, a.uid,a.loan_amount, - a.payment_month,a.sales_agent,a.gender, - a.marital_status,a.email,a.address, - a.state,a.country,a.status,a.added, - a.updated - FROM applications a - LEFT JOIN customers c ON c.uid = a.customer_uid WHERE a.status = 7 "); + $query = $this->db->query("SELECT uid,name FROM salary_sources"); + $salary_sources = $query->getResult('array'); + + $query = $this->db->query("SELECT * FROM employers"); $row = $query->getResult('array'); $data = [ 'call_return' => '100', + 'salary_sources' => $salary_sources, + 'employer_sector' => $employer_sector, 'records' => $row ]; return $this->respond($data, 200); - // return $this->respond([], 200); - } } \ No newline at end of file