diff --git a/app/Controllers/BkoReports.php b/app/Controllers/BkoReports.php index d52d8df..61ff5e6 100644 --- a/app/Controllers/BkoReports.php +++ b/app/Controllers/BkoReports.php @@ -10,7 +10,13 @@ class BkoReports extends BaseController public function startedApplication() :ResponseInterface { //SELECT uid,loan_amount,payment_month,sales_agent,gender,marital_status,email,address,state,country,status,added,updated FROM applications; - $query = $this->db->query("SELECT uid,loan_amount,payment_month,sales_agent,gender,marital_status,email,address,state,country,status,added,updated FROM applications "); + $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 "); $row = $query->getResult('array'); $data = [ 'call_return' => '100', @@ -19,9 +25,25 @@ class BkoReports extends BaseController return $this->respond($data, 200); // return $this->respond([], 200); } + public function pendingApplication() :ResponseInterface { - return $this->respond([], 200); + //SELECT uid,loan_amount,payment_month,sales_agent,gender,marital_status,email,address,state,country,status,added,updated FROM applications; + $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 "); + $row = $query->getResult('array'); + $data = [ + 'call_return' => '100', + 'records' => $row + ]; + return $this->respond($data, 200); + // return $this->respond([], 200); } + } \ No newline at end of file