タグをEager Loadするようにした
This commit is contained in:
parent
e0942889e9
commit
0c216e79c2
@ -43,7 +43,7 @@ class HomeController extends Controller
|
|||||||
->where('ejaculations.link', '<>', '')
|
->where('ejaculations.link', '<>', '')
|
||||||
->orderBy('ejaculations.ejaculated_date', 'desc')
|
->orderBy('ejaculations.ejaculated_date', 'desc')
|
||||||
->select('ejaculations.*')
|
->select('ejaculations.*')
|
||||||
->with('user')
|
->with('user', 'tags')
|
||||||
->take(5)
|
->take(5)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ SQL
|
|||||||
$query = $query->where('is_private', false);
|
$query = $query->where('is_private', false);
|
||||||
}
|
}
|
||||||
$ejaculations = $query->orderBy('ejaculated_date', 'desc')
|
$ejaculations = $query->orderBy('ejaculated_date', 'desc')
|
||||||
|
->with('tags')
|
||||||
->paginate(20);
|
->paginate(20);
|
||||||
|
|
||||||
return view('user.profile')->with(compact('user', 'ejaculations'));
|
return view('user.profile')->with(compact('user', 'ejaculations'));
|
||||||
@ -116,6 +117,7 @@ SQL
|
|||||||
$query = $query->where('is_private', false);
|
$query = $query->where('is_private', false);
|
||||||
}
|
}
|
||||||
$ejaculations = $query->orderBy('ejaculated_date', 'desc')
|
$ejaculations = $query->orderBy('ejaculated_date', 'desc')
|
||||||
|
->with('tags')
|
||||||
->paginate(20);
|
->paginate(20);
|
||||||
|
|
||||||
return view('user.profile')->with(compact('user', 'ejaculations'));
|
return view('user.profile')->with(compact('user', 'ejaculations'));
|
||||||
|
Loading…
Reference in New Issue
Block a user