Merge branch 'trunk'

This commit is contained in:
Jérémy Munsch 2021-11-26 12:42:20 +01:00
commit 30cbcb59bd
No known key found for this signature in database
GPG key ID: 55196BEE445F6049

View file

@ -288,12 +288,12 @@ class Employee extends Authenticatable
$now = Carbon::now()->format('Y/m/d'); $now = Carbon::now()->format('Y/m/d');
$nowPlus7 = Carbon::now()->addDays(7)->format('Y/m/d'); $nowPlus7 = Carbon::now()->addDays(7)->format('Y/m/d');
return collect([ return collect([
'now' => Planning::whereDate('start', '<', $now) 'now' => Planning::whereDate('start', '<=', $now)
->whereDate('end', '>', $now) ->whereDate('end', '>=', $now)
->where('employee_id', $this->id) ->where('employee_id', $this->id)
->first(), ->first(),
'next' => Planning::whereDate('start', '<', $nowPlus7) 'next' => Planning::whereDate('start', '<=', $nowPlus7)
->whereDate('end', '>', $nowPlus7) ->whereDate('end', '>=', $nowPlus7)
->where('employee_id', $this->id) ->where('employee_id', $this->id)
->first() ->first()
]); ]);