非公開ユーザの考慮漏れ

This commit is contained in:
shibafu 2018-01-07 22:42:30 +09:00
parent eb1884200b
commit efd5eab5e6
1 changed files with 7 additions and 3 deletions

View File

@ -36,9 +36,13 @@ class HomeController extends Controller
if (Auth::check()) {
// お惣菜コーナー用のデータ取得
$publicLinkedEjaculations = Ejaculation::where('is_private', false)
->where('link', '<>', '')
->orderBy('ejaculated_date', 'desc')
$publicLinkedEjaculations = Ejaculation::join('users', 'users.id', '=', 'ejaculations.user_id')
->where('users.is_protected', false)
->where('ejaculations.is_private', false)
->where('ejaculations.link', '<>', '')
->orderBy('ejaculations.ejaculated_date', 'desc')
->select('ejaculations.*')
->with('user')
->take(5)
->get();