[Operator] Pembaruan Laman Operator
This commit is contained in:
@@ -28,7 +28,7 @@ final class SubjectGroups
|
||||
{
|
||||
$q = mb_strtolower(trim((string) ($filter['q'] ?? '')));
|
||||
|
||||
return $this->owned($prodi)
|
||||
$rows = $this->owned($prodi)
|
||||
->join('t_bagian as b', 'b.idbagian', '=', 'k.idprogdi')
|
||||
->leftJoin('t_periodekuliah as p', 'p.idperiode', '=', 'k.idperiode')
|
||||
->when($filter['prodi'] ?? null, fn (Builder $query, int $id) => $query->where('k.idprogdi', $id))
|
||||
@@ -49,6 +49,19 @@ final class SubjectGroups
|
||||
'nama' => trim((string) $j->keterangan) ?: '–',
|
||||
'mk' => (int) $j->jumlah_mk,
|
||||
]);
|
||||
|
||||
// Modal Lihat: anggota mata kuliah tiap kelompok sebagai baris tabel (semester, kode, nama, SKS); satu query per halaman.
|
||||
$members = $this->db()->table('t_matakuliah')->whereIn('idjenis', array_column($rows->items(), 'id'))
|
||||
->orderBy('semester')->orderBy('kodemk')->orderBy('idmatakuliah')
|
||||
->get(['idjenis', 'kodemk', 'namamk', 'sks', 'semester'])
|
||||
->groupBy(fn (object $m): int => (int) $m->idjenis);
|
||||
$rows->setCollection($rows->getCollection()->map(function (array $row) use ($members): array {
|
||||
$row['anggota'] = Curriculum::coursesBySemester($members[$row['id']] ?? collect());
|
||||
|
||||
return $row;
|
||||
}));
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user