Merge pull request #285 from shikorism/fix/hide-private-like-in-like-users

いいね非公開のユーザーが、チェックイン画面のいいね件数欄に露出してしまう不具合の修正
This commit is contained in:
shibafu 2019-09-15 02:02:42 +09:00 committed by GitHub
commit c42a3d2657
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,6 +56,7 @@ class Ejaculation extends Model
},
'likes.user' => function ($query) {
$query->where('is_protected', false)
->where('private_likes', false)
->orWhere('id', Auth::id());
}
])
@ -72,7 +73,8 @@ class Ejaculation extends Model
$query->latest()->take(10);
},
'likes.user' => function ($query) {
$query->where('is_protected', false);
$query->where('is_protected', false)
->where('private_likes', false);
}
])
->withCount('likes')