view, search dan tambah daily monitoring

This commit is contained in:
2025-02-18 11:07:55 +07:00
parent a7c7dd8d8f
commit ffaef03945
13 changed files with 823 additions and 96 deletions

View File

@@ -236,6 +236,25 @@ class RequestLogController extends Controller
return Helper::responseJson(data: $manipulatedIcds);
}
public function codeLog(Request $request){
$codeLogs = RequestLog::with(['member'])->when($request->search, function ($q, $search) {
$q->where('code', 'LIKE', "%".$search."%");
$q->orWhereHas('member', function ($subQuery) use ($search) {
$subQuery->where('name', 'LIKE', "%".$search."%");
});
})
->paginate();
$manipulatedIcds = $codeLogs->map(function ($codeLog) {
// Contoh manipulasi, tambahkan atau ubah properti sesuai kebutuhan
return [
'value' => $codeLog->id, // Ganti dengan properti yang sesuai dari model Icd
'label' => $codeLog->code . ' - ' .$codeLog->member->name, // Ganti dengan properti yang sesuai dari model Icd
];
});
return Helper::responseJson(data: $manipulatedIcds);
}
public function hospitals(){
$organizations = Organization::query()
->where([