diff --git a/backend/app/Http/Controllers/Api/AuthenticationTrait.php b/backend/app/Http/Controllers/Api/AuthenticationTrait.php index 21ddfcd1..73d1caa8 100644 --- a/backend/app/Http/Controllers/Api/AuthenticationTrait.php +++ b/backend/app/Http/Controllers/Api/AuthenticationTrait.php @@ -130,7 +130,7 @@ trait AuthenticationTrait { // セッションを想像する $login_user_datum = $this->makeSession($this->getGuard(), $get->toArray()); - return ['status_code' => 200, 'params' => ['id' => $login_user_datum['id'], 'expire' => $expire * 1000]]; + return ['status_code' => 200, 'params' => ['id' => $login_user_datum['id'], 'expire' => (int)$expire * 1000]]; } public function logout () { diff --git a/backend/app/Http/Controllers/Api/FilesController.php b/backend/app/Http/Controllers/Api/FilesController.php index 621c43fe..ab883027 100644 --- a/backend/app/Http/Controllers/Api/FilesController.php +++ b/backend/app/Http/Controllers/Api/FilesController.php @@ -33,7 +33,7 @@ class FilesController extends Controller { // 子供 if (session()->has('children')) { // ミーティング - if (null !== ($rel = FatherRelation::where('child_id', (int)session()->get('children')['id'])->first())) { + foreach ($rel = FatherRelation::where('child_id', (int)session()->get('children')['id'])->get() as $rel) { if (null !== (Meeting::where('father_id', $rel->father_id)->where('pdf', '/files/'.$path)->first())) { $got = true; } @@ -55,7 +55,7 @@ class FilesController extends Controller { if (null !== ($meetimg = MeetingImage::where('image', '/files/'.$path)->first())) { // 子供 if (session()->has('children')) { - if (null !== ($rel = FatherRelation::where('child_id', (int)session()->get('children')['id'])->first())) { + foreach (FatherRelation::where('child_id', (int)session()->get('children')['id'])->get() as $rel) { if (null !== (Meeting::where('id', $meetimg->meeting_id)->where('father_id', $rel->father_id)->first())) { $got = true; }