diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 450711e..008b806 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -22,7 +22,8 @@ $routes->get('/digibko/v1/loan/verified', 'BkoReports::writingApplication') $routes->get('/digibko/v1/loan/approved', 'BkoReports::approvedApplication'); $routes->get('/digibko/v1/loan/rejected', 'BkoReports::rejectedApplication'); -$routes->post('/digibko/v1/loan/process', 'Loan::loanProcess'); +$routes->get('/digibko/v1/loan/process/(:any)', 'Loan::loanProcess/$1'); +//$routes->get('/en/wrench/api/v1/blogdata/(:any)', 'WrenchBlog::blogLimitedData/$1'); $routes->get('/digibko/v1/employers', 'BkoReports::employersList'); diff --git a/app/Controllers/Loan.php b/app/Controllers/Loan.php index 38d68d5..4abb250 100644 --- a/app/Controllers/Loan.php +++ b/app/Controllers/Loan.php @@ -17,11 +17,32 @@ class Loan extends BaseController public function loanProcess(){ - $data = $this->request->getPost(); + // $get_param = $_GET ?? null; + $uriSegments = explode("/", parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); + $segLen = count($uriSegments); + + $application_uid = $uriSegments[$segLen -1]; + // $this->$segLen + + $employerQr = "SELECT * FROM applications WHERE uid::text = '".$application_uid."' "; + log_message('error', "employerQr -->" . $employerQr); + $query = $this->db->query( $employerQr); + $application = $query->getResult('array'); - return $this->respond($data, 200); + $sqlV = "SELECT * FROM employer_checks WHERE application_uid::text ='".$application_uid."' ORDER BY id DESC LIMIT 1"; + log_message('error', "employerQr -->" . $employerQr); + $query = $this->db->query( $sqlV); + $verification = $query->getResult('array'); + + $result =[ + "application_uid" => $application_uid, + "application" => $application, + "verification" => $verification + ]; + return $this->respond($result, 200); } + public function loanApply(){ /* uid uuid,