add jumlahBakiLelong
This commit is contained in:
@@ -429,4 +429,21 @@ class CustomerController extends Controller
|
||||
|
||||
return response()->json(number_format($jumlahPembiayaan,2));
|
||||
}
|
||||
|
||||
public function jumlahBakiLelongMobile($nokp){
|
||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||
$jumlahBakiLelong = 0;
|
||||
foreach($cawangan_all as $index=>$cawangan){
|
||||
$bakilelong = Gadai::on($cawangan['mysql'])
|
||||
->where('nokp','=',$nokp)
|
||||
->where('sttebus','=','L')
|
||||
->where('baki', 'not like', '-%')
|
||||
->where('tagtbaki','=','1')
|
||||
->rightJoin('lelong', 'gadai.norujukan', '=', 'lelong.norujukan')
|
||||
->sum('baki');
|
||||
$jumlahBakiLelong += $bakilelong;
|
||||
}
|
||||
|
||||
return response()->json(number_format($jumlahBakiLelong,2));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user