process loan

This commit is contained in:
CHIEFSOFT\ameye
2024-08-04 23:20:44 -04:00
parent f4b4dd28ae
commit aca7f12c57
+17 -3
View File
@@ -17,6 +17,20 @@ class Users extends BaseController
} }
public function userDash(){ public function userDash(){
$statusDetail[2] =[
"text" => "Pending",
"button" => false
];
$statusDetail[4] =[
"text" => "Add Card",
"button" => true
];
$statusDetail[7] =[
"text" => "Canceled",
"button" => false
];
$in = $this->request->getGet(); $in = $this->request->getGet();
$data = []; $data = [];
if ($in['uid'] !=''){ if ($in['uid'] !=''){
@@ -27,17 +41,17 @@ class Users extends BaseController
$loanResult = $this->userLoan($in['uid']); $loanResult = $this->userLoan($in['uid']);
$processLoan = []; $processLoan = [];
foreach ($loanResult as $value) { foreach ($loanResult as $value) {
$value["status_text"] = "Ameye"; $value["status_text"] = $statusDetail[ $value["status"] ];
$processLoan[] = $value; $processLoan[] = $value;
} }
$data = [ $data = [
'call_return' => '100', 'call_return' => '100',
'customer' => $row, 'customer' => $row,
'loans' => $loanResult, 'loans' => $processLoan,
'lln' => $processLoan
]; ];
return $this->respond($data, 200); return $this->respond($data, 200);
//'loans' => $loanResult,
} }
else{ else{
return $this->respond(['error'=>'empty uid'], 400); return $this->respond(['error'=>'empty uid'], 400);