Update Hospital Portal
This commit is contained in:
@@ -267,6 +267,35 @@ class ClaimRequestController extends Controller
|
||||
|
||||
$query->orderBy($orderBy, $direction);
|
||||
})
|
||||
->when($request->input('start_date') && !$request->input('end_date'), function ($query, $start_date) {
|
||||
$query->where(function ($query) use ($start_date) {
|
||||
$query->where('claim_requests.submission_date', '<', $start_date);
|
||||
});
|
||||
})
|
||||
->when($request->input('status'), function ($query, $status) {
|
||||
$query->where(function ($query) use ($status) {
|
||||
|
||||
if ($status === 'requested') {
|
||||
$query->where('claim_requests.status', '=', 'requested');
|
||||
}
|
||||
|
||||
if ($status === 'reviewed') {
|
||||
$query->where('claim_requests.status', '=', 'approved');
|
||||
$query->where('claims.status', '=', 'received');
|
||||
}
|
||||
|
||||
if ($status === 'approved') {
|
||||
$query->where('claim_requests.status', '=', 'approved');
|
||||
$query->where('claims.status', '=', 'approved');
|
||||
}
|
||||
|
||||
if ($status === 'declined') {
|
||||
$query->where('claim_requests.status', '=', 'approved');
|
||||
$query->where('claims.status', '=', 'declined');
|
||||
}
|
||||
|
||||
});
|
||||
})
|
||||
->select('members.id', 'claim_requests.code','members.member_id', 'members.name as full_name', 'corporate_divisions.name AS division_name',
|
||||
DB::raw('
|
||||
CASE
|
||||
|
||||
Reference in New Issue
Block a user