| @@ 8-19 (lines=12) @@ | ||
| 5 | use Illuminate\Database\Eloquent\Collection; |
|
| 6 | use SET\User; |
|
| 7 | ||
| 8 | class Separated extends CollectionList |
|
| 9 | { |
|
| 10 | public function getList() : Collection |
|
| 11 | { |
|
| 12 | return User::where(function ($q) { |
|
| 13 | $q->where('status', 'separated')->orWhere('status', 'destroyed'); |
|
| 14 | }) |
|
| 15 | ->whereBetween('destroyed_date', [$this->start, $this->end]) |
|
| 16 | ->get(); |
|
| 17 | } |
|
| 18 | } |
|
| 19 | ||
| @@ 8-19 (lines=12) @@ | ||
| 5 | use Illuminate\Database\Eloquent\Collection; |
|
| 6 | use SET\TrainingUser; |
|
| 7 | ||
| 8 | class TrainingUsers extends CollectionList |
|
| 9 | { |
|
| 10 | public function getList() : Collection |
|
| 11 | { |
|
| 12 | return TrainingUser::with('user', 'training') |
|
| 13 | ->whereBetween('due_date', [$this->start, $this->end]) |
|
| 14 | ->whereNull('completed_date') |
|
| 15 | ->orderBy('training_id') |
|
| 16 | ->get(); |
|
| 17 | } |
|
| 18 | } |
|
| 19 | ||