Merge branch 'master' into 'fiza'

# Conflicts:
#   routes/web.php
This commit is contained in:
Zakwan Hamdan
2021-01-06 03:01:02 +00:00
2 changed files with 40 additions and 2 deletions
+36 -1
View File
@@ -14,6 +14,7 @@ use App\Lelong;
use App\WTD;
use App\HapusKira;
use App\Tebus;
use App\Laptebus;
use Illuminate\Http\Request;
@@ -897,7 +898,41 @@ class GadaiController extends Controller
return response()->json(number_format($gadaiTerkumpul,2));
}
public function outstandingSemasa($ic){
public function showTebusTerkumpul(){
$cawangan_all = Cawangan::on('mysql7')->get();
$current = Carbon::now();
$current = new Carbon();
$tebusTerkumpul = 0;
foreach($cawangan_all as $index=>$cawangan){
$tebus = Tebus::on('mysql6')->where('jenistebus','=','T')->whereYear('t_tebus','=',$current->year)->sum('pinjaman');
$tebusTerkumpul += $tebus;
}
return response()->json(number_format($tebusTerkumpul,2));
}
public function showUpahTerkumpul(){
$cawangan_all = Cawangan::on('mysql7')->get();
$current = Carbon::now();
$current = new Carbon();
$upahTerkumpul = 0;
foreach($cawangan_all as $index=>$cawangan){
$upah = Tebus::on($cawangan['mysql'])->whereYear('t_tebus','=','2020')->get();
// dd($upah);
// $upahTerkumpul += $upah;
if(sizeof($upah) != 0){
foreach($upah as $upahall)
{
$upahTerkumpul += $upahall['bakiupah'];
}
}
}
return response()->json(number_format($upahTerkumpul,2));
}
public function outstandingSemasaCustomer($ic){
$cawangan_all = Cawangan::on('mysql7')->get();
$total_pembiayaan = 0;