Pembaruan tampilan Tri Dharma
This commit is contained in:
@@ -8,7 +8,7 @@ use App\Models\DokSiremun\SubUnitKerja;
|
||||
use App\Models\DokSiremun\UnitKerja;
|
||||
use App\Models\Verifikator\Periode;
|
||||
use App\Models\Verifikator\Team;
|
||||
use App\Models\Verifikator\UnitKerjaPegawai;
|
||||
use App\Models\Verifikator\UnitKerja as UnitKerjaVerifikator;
|
||||
use App\Models\Verifikator\View\Pegawai;
|
||||
use App\Services\DokSiremunService;
|
||||
use App\Services\ImamAVService;
|
||||
@@ -108,7 +108,7 @@ class MataKuliahController extends Controller
|
||||
|
||||
public function getUnitKerjaPegawaiList(): JsonResponse
|
||||
{
|
||||
$unitKerjas = UnitKerjaPegawai::orderBy('nama')->get(['id', 'nama']);
|
||||
$unitKerjas = UnitKerjaVerifikator::orderBy('id')->get(['id', 'nama']);
|
||||
|
||||
return response()->json([
|
||||
'results' => $unitKerjas->map(fn ($item) => ['id' => $item->id, 'text' => $item->nama]),
|
||||
@@ -202,7 +202,11 @@ class MataKuliahController extends Controller
|
||||
$team = Team::find(session('team_id'));
|
||||
$filterUnitKerjaId = $request->input('unit_kerja_id');
|
||||
|
||||
if (! $filterUnitKerjaId && $team && $team->unit_kerja_id > 0) {
|
||||
// "Universitas" (ID 0) = semua dosen yang unit kerjanya bukan fakultas (ID 1-9).
|
||||
// Dicek sebagai string karena "0" dianggap kosong oleh PHP.
|
||||
$filterUniversitas = (string) $filterUnitKerjaId === '0';
|
||||
|
||||
if (! $filterUniversitas && ! $filterUnitKerjaId && $team && $team->unit_kerja_id > 0) {
|
||||
$filterUnitKerjaId = $team->unit_kerja_id;
|
||||
}
|
||||
|
||||
@@ -242,7 +246,11 @@ class MataKuliahController extends Controller
|
||||
unset($data);
|
||||
|
||||
// Filter berdasarkan unit kerja pegawai
|
||||
if ($filterUnitKerjaId) {
|
||||
if ($filterUniversitas) {
|
||||
// Unit kerja yang diketahui tetapi bukan fakultas (ID 1-9)
|
||||
$groupedData = array_filter($groupedData, fn ($row) => $row['unit_kerja_id'] !== null
|
||||
&& ($row['unit_kerja_id'] < 1 || $row['unit_kerja_id'] > 9));
|
||||
} elseif ($filterUnitKerjaId) {
|
||||
$groupedData = array_filter($groupedData, fn ($row) => $row['unit_kerja_id'] == $filterUnitKerjaId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user