|
|
@@ -44,12 +44,12 @@ class CalculateStatisticCompound extends Command |
|
|
|
//calculate all compound [status = Belum Bayar, Bayar & Batal] |
|
|
|
$s1 = ReportOverallCompound::where('status','all')->where('department','all')->where('modul','all')->first(); |
|
|
|
if(!empty($s1)){ |
|
|
|
$s1->total = count(Compound::whereIn('status', ['Belum Bayar', 'Berbayar', 'Batal'])->get(); |
|
|
|
$s1->total = count(Compound::whereIn('status', ['Belum Bayar', 'Berbayar', 'Batal'])->get()); |
|
|
|
$s1->save(); |
|
|
|
}else { |
|
|
|
$dataS = new ReportOverallCompound; |
|
|
|
// $dataS->total = count(Compound::all()); |
|
|
|
$dataS->total = count(Compound::whereIn('status', ['Belum Bayar', 'Berbayar', 'Batal'])->get(); |
|
|
|
$dataS->total = count(Compound::whereIn('status', ['Belum Bayar', 'Berbayar', 'Batal'])->get()); |
|
|
|
$dataS->status = 'all'; |
|
|
|
$dataS->department = 'all'; |
|
|
|
$dataS->modul = 'all'; |