From 6a356d7b59c847840bc8e4e36090832f8032c441 Mon Sep 17 00:00:00 2001 From: nishaMuhd Date: Tue, 2 Apr 2024 15:30:47 +0800 Subject: [PATCH] update formula --- .../Controllers/TransactionOnlineController.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/TransactionOnlineController.php b/app/Http/Controllers/TransactionOnlineController.php index ec39060..40f7209 100644 --- a/app/Http/Controllers/TransactionOnlineController.php +++ b/app/Http/Controllers/TransactionOnlineController.php @@ -541,9 +541,18 @@ class TransactionOnlineController extends Controller }else{ $jenis = 'asal'; } - $result = (new TebusController)->kiraupahTawarruq($gad['kodcaw'],$gad['norujukan'],$jenis); - $gad['keuntungan'] = $result; + $array_utg = new \Illuminate\Http\Request([ + 'jeniskeuntungan' => $jenis + ]); + + $result = (new TebusController)->upahTawarruq($gad['kodcaw'],$gad['norujukan'],$array_utg); + + if($jenis == 'onepercent') { + $gad['keuntungan'] = $result['pendapatan']; + } else { + $gad['keuntungan'] = $result; + } array_push($gadai_all,$gad); } }