Merge branch 'RingkasanBackup' of https://gitlab.com/online-sistem1/api_arrahn into RingkasanBackup

This commit is contained in:
hafifierahman
2023-06-07 22:54:12 +08:00
+6 -8
View File
@@ -380,12 +380,10 @@ class RingkasanHarianServices
$period = CarbonPeriod::create($mula, $hingga); $period = CarbonPeriod::create($mula, $hingga);
$cawangan = Cawangan::on('mysql7')->where('kodcaw','KB2')->get()->toArray(); $cawangan = Cawangan::on('mysql7')->where('kodcaw','KB2')->get()->toArray();
foreach($period as $current){ foreach($cawangan as $index=>$caw){
foreach($cawangan as $index=>$caw){ foreach($period as $current){
DB::connection($caw['mysql'])->beginTransaction(); DB::connection($caw['mysql'])->beginTransaction();
try{ try{
$getTransaksi = $this->getTransaksiHarian($current->toDateString(),$caw['kodcaw'],$caw['mysql']); $getTransaksi = $this->getTransaksiHarian($current->toDateString(),$caw['kodcaw'],$caw['mysql']);
$getPendser = $this->getPendahuluanSerahanHQ($current->toDateString(),$caw['kodcaw'],$caw['mysql']); $getPendser = $this->getPendahuluanSerahanHQ($current->toDateString(),$caw['kodcaw'],$caw['mysql']);
$getPerbelanjaan = $this->getPerbelanjaan($current->toDateString(),$caw['kodcaw'],$caw['mysql']); $getPerbelanjaan = $this->getPerbelanjaan($current->toDateString(),$caw['kodcaw'],$caw['mysql']);
@@ -468,10 +466,10 @@ class RingkasanHarianServices
$main->tebus()->save($tebus); $main->tebus()->save($tebus);
$main->lelong()->save($lelong); $main->lelong()->save($lelong);
$main->gad_id = $gadai->id; $main->gad_id = $gadai->gad_id;
$main->teb_id = $tebus->id; $main->teb_id = $tebus->teb_id;
$main->ans_id = $ansuran->id; $main->ans_id = $ansuran->ans_id;
$main->lel_id = $lelong->id; $main->lel_id = $lelong->lel_id;
}else{ }else{
$ansuran->save(); $ansuran->save();
$tebus->save(); $tebus->save();