added function to update all ig

This commit is contained in:
hafifierahman
2024-10-10 03:04:23 +08:00
parent 8c62ad814f
commit 0303bc7628
6 changed files with 102 additions and 90 deletions
+8 -6
View File
@@ -3834,18 +3834,20 @@ class AdminPageController extends Controller
$cawangan = Cawangan::on('mysql7')->simplePaginate(5);
$check = app(AccountService::class);
$array_all = [];
$array_all = ['current_page' => $cawangan->currentPage()];
foreach($cawangan as $caw){
try{
$test =$check->checkAccount($caw['kodcaw'],'8');
$array_all[$caw['kodcaw']] = $test;
$test =$check->checkAccount($caw['kodcaw'],$request->month);
$array_all['data'][$caw['details_caw']] = $test;
}catch(\Exception $e){
Log::error($caw['kodcaw']);
Log::error($e->getMessage());
Log::error($e);
}
}
return response()->json($array_all);
$response = $array_all;
return response()->json($response);
}
}