diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 6c196dc..2681e56 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -56,5 +56,7 @@ $routes->get('/digiusers/v1/loan/loanlist', 'Loan::loanlist'); $routes->post('/employment/v1/auth', 'Employment::login'); $routes->post('/employment/v1/otp', 'Employment::verifyOTP'); +$routes->post('/employment/v1/verify', 'Employment::verifyEmployment'); + $routes->get('/employment/v1/application', 'Employment::loadApplication'); diff --git a/app/Controllers/Employment.php b/app/Controllers/Employment.php index 7acd4fd..965294c 100644 --- a/app/Controllers/Employment.php +++ b/app/Controllers/Employment.php @@ -46,6 +46,35 @@ class Employment extends BaseController public function verifyOTP() :ResponseInterface { + $data = $this->request->getPost(); + $row =[]; + $session_valid = false; + if ($data['verify_uid'] !='' && $data['otp'] !=''){ + + $sqlVer = " SELECT a.loan_amount,c.firstname,c.lastname,e.name AS employer_name + FROM employer_checks ec + LEFT JOIN applications a ON ec.application_uid::text = a.uid::text + LEFT JOIN customers c ON c.uid::text=a.customer_uid::text + LEFT JOIN employers e ON e.uid::text = a.employer_uid::text + WHERE ec.uid = '".$data['verify_uid']."' "; + + $query = $this->db->query( $sqlVer ); + $rowV = $query->getResult('array'); + if ( $rowV[0]){ + $row = $rowV[0]['uid']; + $session_valid = true; + } + } + + $data = [ + 'call_return' => '100', + 'session_valid' => $session_valid, + 'records' => $row + ]; + return $this->respond($data, 200); + } + + public function verifyEmployment() :ResponseInterface{ $row =[]; $data = [ 'call_return' => '100',