Sementara Fix Filter Date
This commit is contained in:
@@ -37,21 +37,26 @@ class PaymentController extends Controller
|
||||
&& !empty($request->appointment_start)
|
||||
&& !empty($request->appointment_end)
|
||||
) {
|
||||
$appointments = $appointments->whereHas('detail', function (Builder $detail) use ($request) {
|
||||
// $appointments = $appointments->whereHas('detail', function (Builder $detail) use ($request) {
|
||||
|
||||
// Appointment Start
|
||||
// if ($request->has('appointment_start')) {
|
||||
$detail->where('dTanggalAppointment', '>=', $request->appointment_start);
|
||||
// } else {
|
||||
// $detail->where('dTanggalAppointment', '>', now()->format('Y-m-d'));
|
||||
// }
|
||||
// // Appointment Start
|
||||
// // if ($request->has('appointment_start')) {
|
||||
// $detail->where('dTanggalAppointment', '>=', $request->appointment_start);
|
||||
// // } else {
|
||||
// // $detail->where('dTanggalAppointment', '>', now()->format('Y-m-d'));
|
||||
// // }
|
||||
|
||||
// if ($request->has('appointment_end')) {
|
||||
$detail->where('dTanggalAppointment', '<=', $request->appointment_end);
|
||||
// } else {
|
||||
// $detail->where('dTanggalAppointment', '<', now()->addDay(1)->format('Y-m-d'));
|
||||
// }
|
||||
// // if ($request->has('appointment_end')) {
|
||||
// $detail->where('dTanggalAppointment', '<=', $request->appointment_end);
|
||||
// // } else {
|
||||
// // $detail->where('dTanggalAppointment', '<', now()->addDay(1)->format('Y-m-d'));
|
||||
// // }
|
||||
|
||||
// });
|
||||
|
||||
$appointments = $appointments->where(function($q) use ($request) {
|
||||
$q->where('dAgreeOn', '>=', $request->appointment_start)
|
||||
->where('dAgreeOn', '<=', $request->appointment_end);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user