Loan data

This commit is contained in:
CHIEFSOFT\ameye
2024-08-06 13:13:48 -04:00
parent beea16eac9
commit 233dfb5480
2 changed files with 27 additions and 0 deletions
+1
View File
@@ -64,6 +64,7 @@ $routes->get('/digiusers/v1/employers', 'Employers::approvedEmploye
$routes->post('/digiusers/v1/loan/apply', 'Loan::loanApply');
$routes->get('/digiusers/v1/loan/loanlist', 'Loan::loanlist');
$routes->get('/digiusers/v1/loan/loandetail', 'Loan::loanDetail');
$routes->get('/digiusers/v1/loan/paymentcard/add', 'Loan::addPaymentCard');
+26
View File
@@ -3,6 +3,7 @@
namespace App\Controllers;
use CodeIgniter\API\ResponseTrait;
use PHPUnit\Util\Json;
class Loan extends BaseController
{
@@ -161,6 +162,31 @@ disbursement
return $this->respond([], 200);
}
public function loanDetail(){
$in = $this->request->getGet();
$data = [];
$mysql ="SELECT * FROM applications WHERE customer_uid = '". $in["uid"]."' AND uid='". $in["application_uid"]."' ";
$query = $this->db->query($mysql);
$row = $query->getRowArray();
$row["loan_detail"] = json_decode( $row["loan_detail"] ); // "ameye";
//$row["loan_detail"]["employment"] = json_decode( $row["loan_detail"]["employment"] );
$employment_line = json_decode( $row["loan_detail"]->employment ); //["employment"] ;
$row["employment"] = $employment_line ; // json_decode( $row["loan_detail"]["employment"] );
$loan_reference_line = json_decode( $row["loan_detail"]->loan_reference );
$row["loan_reference"] = $loan_reference_line ;
$disbursement_line = json_decode( $row["loan_detail"]->disbursement );
$row["disbursement"] = $disbursement_line ;
return $this->respond(["loan"=>$row], 200);
}
public function startProcessing(){
return [];
}