This commit is contained in:
afiq
2021-10-10 08:50:17 +08:00
parent 9f2b17795c
commit 8c3b1a4d81
3 changed files with 56 additions and 1 deletions
+13 -1
View File
@@ -2984,7 +2984,7 @@ class GadaiController extends Controller
}
$tempoh_update = $year + $month + $extensivemonth;
Gadai::on($cawangan_mysql['mysql'])->where('norujukan','=',$gadai['norujukan'])->update(array(
'jbg' => $tempoh_update,
'jbg' => $tempoh_gadai,
'tempoh' => $tempoh_gadai
));
}
@@ -3096,4 +3096,16 @@ class GadaiController extends Controller
return response()->json($array_totalup);
}
public function hapusGadaiNull(){
$cawangan_all = Cawangan::on('mysql7')->get();
foreach($cawangan_all as $index=>$cawangan){
$gadaiData = Gadai::on($cawangan['mysql'])->where([['nilaimarhun',null],['pinjaman',null]])->orWhere([['nilaimarhun',0.00],['pinjaman',0.00]])->pluck('norujukan');
$deleteMarhun = Marhun::on($cawangan['mysql'])->whereIn('norujukan',$gadaiData)->delete();
$deleteGadai = Gadai::on($cawangan['mysql'])->whereIn('norujukan',$gadaiData)->delete();
}
}
}