Siti Rahayu пре 4 година
родитељ
комит
119ba4f7ff
1 измењених фајлова са 6 додато и 6 уклоњено
  1. 6
    6
      app/Console/Commands/CalculateStatisticCompound.php

+ 6
- 6
app/Console/Commands/CalculateStatisticCompound.php Прегледај датотеку

@@ -57,13 +57,13 @@ class CalculateStatisticCompound extends Command
}
//calculate compound [modul = 03, status = Belum Bayar]
$b1 = ReportOverallCompound::where('status','Belum Bayar')->where('department','all')->where('modul','03')->first();
$b1 = ReportOverallCompound::where('status','Belum Bayar')->where('department','all')->where('modul','03')->orWhere('modul','02')->first();
if(!empty($b1)){
$b1->total = count(Compound::where('modul','03')->where('status','Belum Bayar')->get());
$b1->total = count(Compound::where('modul','03')->orWhere('modul','02')->where('status','Belum Bayar')->get());
$b1->save();
}else {
$dataB = new ReportOverallCompound;
$dataB->total = count(Compound::where('modul','03')->where('status','Belum Bayar')->get());
$dataB->total = count(Compound::where('modul','03')->orWhere('modul','02')->where('status','Belum Bayar')->get());
$dataB->status = 'Belum Bayar';
$dataB->department = 'all';
$dataB->modul = '03';
@@ -162,13 +162,13 @@ class CalculateStatisticCompound extends Command
}

//calcculate compound by department [status = Belum Bayar, modul = 03]
$b2 = ReportOverallCompound::where('status','Belum Bayar')->where('department',$d->_id)->where('modul','03')->first();
$b2 = ReportOverallCompound::where('status','Belum Bayar')->where('department',$d->_id)->where('modul','03')->orWhere('modul','02')->first();
if(!empty($b2)){
$b2->total = count(Compound::where('jbkod',$d->_id)->where('modul','03')->where('status','Belum Bayar')->get());
$b2->total = count(Compound::where('jbkod',$d->_id)->where('modul','03')->orWhere('modul','02')->where('status','Belum Bayar')->get());
$b2->save();
}else {
$dataJB1 = new ReportOverallCompound;
$dataJB1->total = count(Compound::where('jbkod',$d->_id)->where('modul','03')->where('status','Belum Bayar')->get());
$dataJB1->total = count(Compound::where('jbkod',$d->_id)->where('modul','03')->orWhere('modul','02')->where('status','Belum Bayar')->get());
$dataJB1->status = 'Belum Bayar';
$dataJB1->department = $d->_id;
$dataJB1->modul = '03';

Loading…
Откажи
Сачувај