@@ -47,12 +47,12 @@ |
||
| 47 | 47 | |
| 48 | 48 | private static function withFilter() |
| 49 | 49 | { |
| 50 | - return ['groups' => function ($query) { |
|
| 50 | + return [ 'groups' => function($query) { |
|
| 51 | 51 | $query->select('id', 'company_id'); |
| 52 | - }, 'groups.meetings' => function ($query) { |
|
| 52 | + }, 'groups.meetings' => function($query) { |
|
| 53 | 53 | $query->select('id', 'group_id', 'start_time'); |
| 54 | - }, 'groups.meetings.employees' => function ($query) { |
|
| 54 | + }, 'groups.meetings.employees' => function($query) { |
|
| 55 | 55 | $query->select('id'); |
| 56 | - }]; |
|
| 56 | + } ]; |
|
| 57 | 57 | } |
| 58 | 58 | } |
@@ -39,10 +39,11 @@ |
||
| 39 | 39 | { |
| 40 | 40 | // |
| 41 | 41 | $companyId = $this->argument('companyId'); |
| 42 | - if (is_numeric($companyId)) |
|
| 43 | - print_r(Company::findOrFail($companyId)->with(self::withFilter())->get()->toArray()); |
|
| 44 | - else |
|
| 45 | - print_r(Company::with(self::withFilter())->select('id')->get()->toArray()); |
|
| 42 | + if (is_numeric($companyId)) { |
|
| 43 | + print_r(Company::findOrFail($companyId)->with(self::withFilter())->get()->toArray()); |
|
| 44 | + } else { |
|
| 45 | + print_r(Company::with(self::withFilter())->select('id')->get()->toArray()); |
|
| 46 | + } |
|
| 46 | 47 | } |
| 47 | 48 | |
| 48 | 49 | private static function withFilter() |