member dash
This commit is contained in:
@@ -17,16 +17,31 @@ class Users extends BaseController
|
||||
}
|
||||
|
||||
public function userDash(){
|
||||
$in = $this->request->getGet();
|
||||
$data = [];
|
||||
if ($in['uid'] !=''){
|
||||
$query = $this->db->query("SELECT * FROM customers WHERE uid = '".$in['uid']."' ");
|
||||
|
||||
$data = [
|
||||
'firstname' => 'Olarewaju',
|
||||
'lastname' => 'Jackson',
|
||||
'loan_status' => '0',
|
||||
];
|
||||
$row = $query->getRowArray();
|
||||
$data = [
|
||||
'call_return' => '100',
|
||||
'customer' => $row,
|
||||
'loans' => $this->userLoan($in['uid'])
|
||||
];
|
||||
return $this->respond($data, 200);
|
||||
}
|
||||
|
||||
return $this->respond($data, 200);
|
||||
return $this->respond([], 400);
|
||||
}
|
||||
|
||||
private function userLoan($uid){
|
||||
$query = $this->db->query("SELECT a.uid AS application_uid,a.loan_amount,
|
||||
a.payment_month,a.status,a.added,
|
||||
a.updated
|
||||
FROM applications a
|
||||
LEFT JOIN customers c ON c.uid = a.customer_uid WHERE a.customer_uid='".$uid."' ");
|
||||
return $query->getResult('array');
|
||||
}
|
||||
public function userProfile(){
|
||||
$in = $this->request->getGet();
|
||||
$data = [];
|
||||
@@ -40,7 +55,7 @@ class Users extends BaseController
|
||||
return $this->respond($data, 200);
|
||||
}
|
||||
|
||||
|
||||
return $this->respond([], 400);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user