1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-25 09:17:03 +00:00

Do not recommend myself

Signed-off-by: Marcin Mikołajczak <me@m4sk.in>
This commit is contained in:
Marcin Mikołajczak 2018-06-01 19:05:12 +02:00
parent efbb1017e7
commit 71c90c8f49

View file

@ -16,8 +16,8 @@ class DiscoverController extends Controller
public function home() public function home()
{ {
$following = Follower::whereProfileId(Auth::user()->profile->id)->pluck('following_id'); $following = Follower::whereProfileId(Auth::user()->profile->id)->pluck('following_id');
$people = Profile::inRandomOrder()->whereNotIn('id', $following)->take(3)->get(); $people = Profile::inRandomOrder()->where('id', '!=', Auth::user()->profile->id)->whereNotIn('id', $following)->take(3)->get();
$posts = Status::whereHas('media')->whereNotIn('profile_id', $following)->orderBy('created_at', 'desc')->take('21')->get(); $posts = Status::whereHas('media')->where('profile_id', '!=', Auth::user()->profile->id)->whereNotIn('profile_id', $following)->orderBy('created_at', 'desc')->take('21')->get();
return view('discover.home', compact('people', 'posts')); return view('discover.home', compact('people', 'posts'));
} }