addded agreements page

This commit is contained in:
CHIEFSOFT\ameye
2024-09-17 12:24:50 -04:00
parent 8ecbdb04e0
commit a5f850d62c
2 changed files with 18 additions and 0 deletions
+1
View File
@@ -60,6 +60,7 @@ $routes->post('/digiusers/v1/bvn', 'DigiFiBVN::startBVNVerify')
$routes->post('/digiusers/v1/bvn/verify', 'DigiFiBVN::completeBVNVerify');
$routes->get('/digiusers/v1/dash', 'Users::userDash');
$routes->get('/digiusers/v1/agreements', 'Users::userAgreement');
$routes->get('/digiusers/v1/dash/profile', 'Users::userDashProfile');
$routes->get('/digiusers/v1/dash/employer', 'Users::userDashEmployer');
+17
View File
@@ -118,6 +118,23 @@ class Users extends BaseController
//return $this->respond([], 400);
}
/*
digifi_db=# SELECT c.added,c.loan_amount,c.payment_month,a.status,a.loan_uid FROM agreements a LEFT JOIN applications c ON c.uid::text = a.loan_uid;
added | loan_amount | payment_month | status | loan_uid
----------------------------+-------------+---------------+--------+--------------------------------------
2024-06-01 17:31:51.124457 | 55555 | 18 | 1 | 21f7ffb3-c5a3-4f36-a419-464f91b3645d
2024-06-04 16:54:22.86312 | 1000000 | 6 | 1 | 808c6df4-5b9c-4d52-944b-918f1f9576d3
2024-06-04 16:58:53.691384 | 100000 | 18 | 1 | 4ca44a89-1bb6-4af3-93c0-71a03fe2d407
2024-06-04 17:10:52.018562 | 500000 | 12 | 1 | 67cb2d61-9db5-470e-b542-a70bc828a064
(4 rows)
*/
public function userAgreement(){
$query = $this->db->query("SELECT c.added,c.loan_amount,c.payment_month,a.status,a.loan_uid FROM agreements a LEFT JOIN applications c ON c.uid::text = a.loan_uid");
$data = $query->getResult('array');
return $this->respond($data, 200);
}
private function userLoan($uid){
$query = $this->db->query("SELECT a.uid AS application_uid,a.loan_amount,
a.payment_month,a.status,a.added,