terkumpul

This commit is contained in:
Afiq
2021-01-06 10:55:59 +08:00
parent f5f873b3a8
commit 549473079c
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;
@@ -880,7 +881,41 @@ class GadaiController extends Controller
return response()->json($upahToday);
}
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;