fix primary key
This commit is contained in:
@@ -377,16 +377,13 @@ class RingkasanHarianServices
|
||||
|
||||
public function StoreRingkasanHarian(){
|
||||
|
||||
$period = CarbonPeriod::create('2023-01-01', '2023-03-31');
|
||||
$period = CarbonPeriod::create('2023-01-01', '2023-05-31');
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','KB2')->get()->toArray();
|
||||
|
||||
// foreach()
|
||||
foreach($period as $current){
|
||||
foreach($cawangan as $index=>$caw){
|
||||
foreach($cawangan as $index=>$caw){
|
||||
foreach($period as $current){
|
||||
DB::connection($caw['mysql'])->beginTransaction();
|
||||
|
||||
try{
|
||||
|
||||
$getTransaksi = $this->getTransaksiHarian($current->toDateString(),$caw['kodcaw'],$caw['mysql']);
|
||||
$getPendser = $this->getPendahuluanSerahanHQ($current->toDateString(),$caw['kodcaw'],$caw['mysql']);
|
||||
$getPerbelanjaan = $this->getPerbelanjaan($current->toDateString(),$caw['kodcaw'],$caw['mysql']);
|
||||
@@ -469,10 +466,10 @@ class RingkasanHarianServices
|
||||
$main->tebus()->save($tebus);
|
||||
$main->lelong()->save($lelong);
|
||||
|
||||
$main->gad_id = $gadai->id;
|
||||
$main->teb_id = $tebus->id;
|
||||
$main->ans_id = $ansuran->id;
|
||||
$main->lel_id = $lelong->id;
|
||||
$main->gad_id = $gadai->gad_id;
|
||||
$main->teb_id = $tebus->teb_id;
|
||||
$main->ans_id = $ansuran->ans_id;
|
||||
$main->lel_id = $lelong->lel_id;
|
||||
}else{
|
||||
$ansuran->save();
|
||||
$tebus->save();
|
||||
|
||||
Reference in New Issue
Block a user