Merge branch 'apiaku' into 'master'

fix last keuntungan_rebet

See merge request online-sistem1/api_arrahn!89
This commit is contained in:
hafifie rahman
2021-04-22 06:37:30 +00:00
2 changed files with 33 additions and 5 deletions
-5
View File
@@ -762,9 +762,6 @@ class TebusController extends Controller
$dateSM = new Carbon('2021-04-21');
$dateSM->addDays(1);
$dateRM = new Carbon('2021-04-22');
$dateRM->addDays(1);
$current = Carbon::now();
$current = new Carbon();
@@ -780,12 +777,10 @@ class TebusController extends Controller
->join($cawangan['db_name'].'.gadai as db2','transaksi_keuntungan.norujukan','=','db2.norujukan')
// ->where('transaksi_keuntungan.tarikh_bayaran' ,'>=', $datetawarruq)
->where('transaksi_keuntungan.tarikh_bayaran' ,'<=', $daterequest)
->where('transaksi_keuntungan.tarikh_bayaran' ,'>=', $dateRM)
->whereYear('tarikh_bayaran','=',$current->year)
->whereNotNull('db2.hargajualan')
->sum('keuntungan_rebet');
$total = $keuntungan + $keuntunganreducing;
return response($total);