@@ -26,9 +26,11 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | $employee = \Auth::user(); |
| 28 | 28 | $meetings = $employee->meetings(); |
| 29 | - if ($request->query('current')) |
|
| 30 | - $meetings->where(function ($query) { //parenthesis for conditions ...(C1 OR C2)... |
|
| 31 | - $query->where('start_time', '=', NULL);//to be planned |
|
| 29 | + if ($request->query('current')) { |
|
| 30 | + $meetings->where(function ($query) { //parenthesis for conditions ...(C1 OR C2)... |
|
| 31 | + $query->where('start_time', '=', NULL); |
|
| 32 | + } |
|
| 33 | + //to be planned |
|
| 32 | 34 | //datetime to consider timezone, don't use mysql NOW() |
| 33 | 35 | $query->orWhere('start_time', '>=', new \DateTime());//planned |
| 34 | 36 | }); |
@@ -62,8 +64,9 @@ discard block |
||
| 62 | 64 | $meeting = Group::findOrFail($meetingId); |
| 63 | 65 | $this->authorize($meeting); |
| 64 | 66 | $ret = self::getImg($meeting); |
| 65 | - if ($ret === false) |
|
| 66 | - return \Response::json(['error' => 'The file is not uploaded'], 404); |
|
| 67 | + if ($ret === false) { |
|
| 68 | + return \Response::json(['error' => 'The file is not uploaded'], 404); |
|
| 69 | + } |
|
| 67 | 70 | return (new Response($ret, 200)) |
| 68 | 71 | ->header('Content-Type', 'image/jpeg'); |
| 69 | 72 | } |
@@ -71,8 +74,9 @@ discard block |
||
| 71 | 74 | private static function getImg(Meeting $meeting) |
| 72 | 75 | { |
| 73 | 76 | $name = 'meetings/' . $meeting->id; |
| 74 | - if (!\Storage::exists($name)) |
|
| 75 | - return false; |
|
| 77 | + if (!\Storage::exists($name)) { |
|
| 78 | + return false; |
|
| 79 | + } |
|
| 76 | 80 | return \Storage::get($name); |
| 77 | 81 | } |
| 78 | 82 | } |