This commit is contained in:
Dwi Swandhana
2026-07-19 20:47:08 +07:00
parent 616f0658d6
commit 30e39875c0
4 changed files with 137 additions and 41 deletions
@@ -553,6 +553,13 @@ class ReportController extends Controller
->whereIn('id', array_unique($poli_ids))
->get()
->keyBy('id');
$preliminaries = DB::table('riwayatjawaban')
->select('nofoto', 'created_at')
->whereIn('nofoto', array_unique($acc))
->where('keterangan', 'Preliminary Results')
->orderBy('created_at', 'DESC')
->get()
->groupBy('nofoto');
foreach ($hasil as $row) {
$k = $komponen[$row->nofoto] ?? collect([]);
$row->id_bakteri01 = optional($k->firstWhere('komponen','id_bakteri01'))->isidata;
@@ -567,6 +574,7 @@ class ReportController extends Controller
->implode('; ');
$row->filefoto = "<a href='".url('/hasil/'.$row->nofoto)."'>$row->nofoto</a>";
$row->tgl_preliminary = optional(($preliminaries[$row->nofoto] ?? collect([]))->first())->created_at;
$p = $poli[$row->poli_id] ?? null;
$row->subpoli = $p->subpoli ?? null;
$row->modaliti2 = $this->resolveTatTargetDays($p->modaliti2 ?? '1');