| @@ 35-38 (lines=4) @@ | ||
| 32 | session(['userStatus' => $userStatus]); |
|
| 33 | if ($userStatus) { |
|
| 34 | $users = User::with([ |
|
| 35 | 'assignedTrainings' => function ($q) { |
|
| 36 | $q->whereNull('completed_date') |
|
| 37 | ->whereBetween('due_date', [Carbon::now()->subYear(), Carbon::now()->addWeeks(4)]); |
|
| 38 | }, |
|
| 39 | 'trainings', |
|
| 40 | ]) |
|
| 41 | ->skipSystem() |
|
| @@ 46-49 (lines=4) @@ | ||
| 43 | ->orderBy('last_name')->get(); |
|
| 44 | } else { |
|
| 45 | $users = User::with([ |
|
| 46 | 'assignedTrainings' => function ($q) { |
|
| 47 | $q->whereNull('completed_date') |
|
| 48 | ->whereBetween('due_date', [Carbon::now()->subYear(), Carbon::now()->addWeeks(4)]); |
|
| 49 | }, |
|
| 50 | 'trainings', |
|
| 51 | ]) |
|
| 52 | ->skipSystem() |
|