@@ -39,10 +39,11 @@ |
||
39 | 39 | { |
40 | 40 | // |
41 | 41 | $companyId = $this->argument('companyId'); |
42 | - if (is_numeric($companyId)) |
|
43 | - print_r(Company::with(self::withFilter())->findOrFail($companyId)->toArray()); |
|
44 | - else |
|
45 | - print_r(Company::with(self::withFilter())->select('id')->get()->toArray()); |
|
42 | + if (is_numeric($companyId)) { |
|
43 | + print_r(Company::with(self::withFilter())->findOrFail($companyId)->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() |
@@ -32,9 +32,11 @@ discard block |
||
32 | 32 | $group = Group::findOrFail($groupId); |
33 | 33 | $this->authorize($group); |
34 | 34 | $meetings = $group->meetings(); |
35 | - if ($request->query('current')) |
|
36 | - $meetings->where(function ($query) { //parenthesis for conditions ...(C1 OR C2)... |
|
37 | - $query->where('start_time', '=', NULL);//to be planned |
|
35 | + if ($request->query('current')) { |
|
36 | + $meetings->where(function ($query) { //parenthesis for conditions ...(C1 OR C2)... |
|
37 | + $query->where('start_time', '=', NULL); |
|
38 | + } |
|
39 | + //to be planned |
|
38 | 40 | //datetime to consider timezone, don't use mysql NOW() |
39 | 41 | $query->orWhere('start_time', '>=', new \DateTime());//planned |
40 | 42 | }); |
@@ -91,8 +93,9 @@ discard block |
||
91 | 93 | $meeting = Meeting::findOrFail($meetingId); |
92 | 94 | $this->authorize($meeting); |
93 | 95 | $input = $request->all(); |
94 | - if ($meeting->start_time != NULL && $meeting->duration != $input['duration']) |
|
95 | - return Response::json(['error' => 'the meeting is already planned, you cannot change the duration'], 422); |
|
96 | + if ($meeting->start_time != NULL && $meeting->duration != $input['duration']) { |
|
97 | + return Response::json(['error' => 'the meeting is already planned, you cannot change the duration'], 422); |
|
98 | + } |
|
96 | 99 | $meeting->update($input); |
97 | 100 | return $meeting; |
98 | 101 | } |
@@ -61,11 +61,13 @@ |
||
61 | 61 | if ($request->input('remember', false)) { |
62 | 62 | config(['jwt.ttl' => '43200']); //30 days |
63 | 63 | $this->custom = array_merge($this->custom, ['remember' => 'true']); |
64 | - } else |
|
65 | - $this->custom = array_merge($this->custom, ['remember' => 'false']); |
|
64 | + } else { |
|
65 | + $this->custom = array_merge($this->custom, ['remember' => 'false']); |
|
66 | + } |
|
66 | 67 | $ret = $this->postLoginOriginal($request); |
67 | - if($ret->getStatusCode() == 200) |
|
68 | - Company::whereEmail($request->input('email'))->first()->gcms()->save(new GcmCompanyModel($request->input('token'))); |
|
68 | + if($ret->getStatusCode() == 200) { |
|
69 | + Company::whereEmail($request->input('email'))->first()->gcms()->save(new GcmCompanyModel($request->input('token'))); |
|
70 | + } |
|
69 | 71 | return $ret; |
70 | 72 | } |
71 | 73 |