bugs fix
This commit is contained in:
@@ -240,25 +240,31 @@ 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."%");
|
||||
});
|
||||
})
|
||||
->get();
|
||||
public function codeLog(Request $request)
|
||||
{
|
||||
$codeLogs = RequestLog::with(['member'])
|
||||
->when($request->search, function ($q) use ($request) {
|
||||
$q->where('code', 'LIKE', "%{$request->search}%")
|
||||
->orWhereHas('member', function ($subQuery) use ($request) {
|
||||
$subQuery->where('name', 'LIKE', "%{$request->search}%");
|
||||
});
|
||||
})
|
||||
->whereHas('member', function ($subQuery) {
|
||||
$subQuery->whereNull('deleted_at');
|
||||
})
|
||||
->get();
|
||||
|
||||
$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
|
||||
'value' => $codeLog->id,
|
||||
'label' => $codeLog->code . ' - ' . ($codeLog->member->name ?? 'Unknown'),
|
||||
];
|
||||
});
|
||||
|
||||
return Helper::responseJson(data: $manipulatedIcds);
|
||||
}
|
||||
|
||||
|
||||
public function hospitals(){
|
||||
$organizations = Organization::query()
|
||||
->where([
|
||||
|
||||
Reference in New Issue
Block a user