mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Update AdminMediaController, improve perf and use simple pagination
This commit is contained in:
parent
4a30ff118d
commit
f2686cacd2
1 changed files with 4 additions and 2 deletions
|
@ -27,6 +27,7 @@ trait AdminMediaController
|
|||
],
|
||||
'search' => 'nullable|string|min:1|max:20'
|
||||
]);
|
||||
|
||||
if($request->filled('search')) {
|
||||
$profiles = Profile::where('username', 'like', '%'.$request->input('search').'%')->pluck('id')->toArray();
|
||||
$media = Media::whereHas('status')
|
||||
|
@ -42,7 +43,8 @@ trait AdminMediaController
|
|||
$media = MediaBlocklist::latest()->paginate(12);
|
||||
return view('admin.media.home', compact('media'));
|
||||
}
|
||||
$media = Media::whereHas('status')->with('status')->orderby('id', 'desc')->paginate(12);
|
||||
|
||||
$media = Media::whereNull('remote_url')->orderby('id', 'desc')->simplePaginate(12);
|
||||
return view('admin.media.home', compact('media'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue