main
Ilham Wara Nugroho 2026-06-11 14:54:55 +07:00
parent 03206a4e80
commit 6710c77f89
1 changed files with 3 additions and 3 deletions

View File

@ -58,7 +58,7 @@ class FormController implements HasMiddleware
// Fetch form details
$formDetails = SettingFormDetail::rowActive()->where('form_code', $code)->orderByRowNum()->get();
dd($instansi);
if ($instansi && $instansi != 'all' && $instansi != 'none') {
$agency = Agency::where('name', $instansi)->rowActive()->first();
$instansi = $agency ? $agency->id : null;
@ -69,7 +69,7 @@ class FormController implements HasMiddleware
$scope = $user->getScope();
if ($scope === LingkupAksesData::INTERNAL->value) {
$instansi = $user->agency_id;
$instansi = $user->ms_agency_id;
}
$agencies = Agency::whereHas('agencyActivity', function ($query) use ($sector, $code, $scope, $user) {
@ -77,7 +77,7 @@ class FormController implements HasMiddleware
->where('form_code', $code);
if ($scope === LingkupAksesData::INTERNAL->value) {
$query->where('agency_id', $user->agency_id);
$query->where('agency_id', $user->ms_agency_id);
}
})->get();