From 834695d72c3a11e01425a372335ddfaf4d6fccbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Fri, 26 Nov 2021 12:42:02 +0100 Subject: [PATCH] Fix Planning show --- app/Models/Employee.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Models/Employee.php b/app/Models/Employee.php index 2ec8af8..75e3bb5 100644 --- a/app/Models/Employee.php +++ b/app/Models/Employee.php @@ -288,12 +288,12 @@ class Employee extends Authenticatable $now = Carbon::now()->format('Y/m/d'); $nowPlus7 = Carbon::now()->addDays(7)->format('Y/m/d'); return collect([ - 'now' => Planning::whereDate('start', '<', $now) - ->whereDate('end', '>', $now) + 'now' => Planning::whereDate('start', '<=', $now) + ->whereDate('end', '>=', $now) ->where('employee_id', $this->id) ->first(), - 'next' => Planning::whereDate('start', '<', $nowPlus7) - ->whereDate('end', '>', $nowPlus7) + 'next' => Planning::whereDate('start', '<=', $nowPlus7) + ->whereDate('end', '>=', $nowPlus7) ->where('employee_id', $this->id) ->first() ]);