From d02b65e4edfb60e286a2f89efa1137ee16def573 Mon Sep 17 00:00:00 2001 From: shibafu Date: Sun, 21 Apr 2019 02:12:42 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E9=9D=9E=E5=85=AC=E9=96=8B=E3=83=81?= =?UTF-8?q?=E3=82=A7=E3=83=83=E3=82=AF=E3=82=A4=E3=83=B3=E3=81=AE=E3=81=84?= =?UTF-8?q?=E3=81=84=E3=81=AD=E3=81=8C=E4=BB=96=E4=BA=BA=E3=81=AB=E8=A6=8B?= =?UTF-8?q?=E3=81=88=E3=81=A6=E3=81=97=E3=81=BE=E3=81=A3=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=9F=E4=B8=8D=E5=85=B7=E5=90=88=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/UserController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 5bdc9b5..04aed97 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -188,6 +188,10 @@ SQL $likes = $user->likes() ->orderBy('created_at', 'desc') ->with('ejaculation.user', 'ejaculation.tags') + ->whereHas('ejaculation', function ($query) { + $query->where('user_id', Auth::id()) + ->orWhere('is_private', false); + }) ->paginate(20); return view('user.likes')->with(compact('user', 'likes')); From 464b690fbdd016ee8c9346b1720f5ca0b6598df6 Mon Sep 17 00:00:00 2001 From: shibafu Date: Sun, 21 Apr 2019 02:14:08 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E9=9D=9E=E5=85=AC=E9=96=8B=E3=83=81?= =?UTF-8?q?=E3=82=A7=E3=83=83=E3=82=AF=E3=82=A4=E3=83=B3=E3=81=AE=E3=81=84?= =?UTF-8?q?=E3=81=84=E3=81=AD=E3=81=AB=E3=80=8C=E9=9D=9E=E5=85=AC=E9=96=8B?= =?UTF-8?q?=E3=80=8D=E3=81=AE=E8=A1=A8=E8=A8=98=E3=81=8C=E3=81=AA=E3=81=8B?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7=E4=BB=98=E3=81=91=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/components/ejaculation.blade.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/views/components/ejaculation.blade.php b/resources/views/components/ejaculation.blade.php index 7b76bcf..cda134b 100644 --- a/resources/views/components/ejaculation.blade.php +++ b/resources/views/components/ejaculation.blade.php @@ -6,8 +6,11 @@ -@if ($ejaculation->tags->isNotEmpty()) +@if ($ejaculation->is_private || $ejaculation->tags->isNotEmpty())

+ @if ($ejaculation->is_private) + 非公開 + @endif @foreach ($ejaculation->tags as $tag) {{ $tag->name }} @endforeach