member dash
This commit is contained in:
@@ -17,16 +17,31 @@ class Users extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function userDash(){
|
public function userDash(){
|
||||||
|
$in = $this->request->getGet();
|
||||||
|
$data = [];
|
||||||
|
if ($in['uid'] !=''){
|
||||||
|
$query = $this->db->query("SELECT * FROM customers WHERE uid = '".$in['uid']."' ");
|
||||||
|
|
||||||
$data = [
|
$row = $query->getRowArray();
|
||||||
'firstname' => 'Olarewaju',
|
$data = [
|
||||||
'lastname' => 'Jackson',
|
'call_return' => '100',
|
||||||
'loan_status' => '0',
|
'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(){
|
public function userProfile(){
|
||||||
$in = $this->request->getGet();
|
$in = $this->request->getGet();
|
||||||
$data = [];
|
$data = [];
|
||||||
@@ -40,7 +55,7 @@ class Users extends BaseController
|
|||||||
return $this->respond($data, 200);
|
return $this->respond($data, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $this->respond([], 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user