mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-30 16:30:45 +00:00
Update AdminController
This commit is contained in:
parent
f5b4362368
commit
a7a16d8a0b
1 changed files with 7 additions and 6 deletions
|
@ -23,7 +23,8 @@ use App\Http\Controllers\Admin\{
|
||||||
AdminInstanceController,
|
AdminInstanceController,
|
||||||
AdminReportController,
|
AdminReportController,
|
||||||
AdminMediaController,
|
AdminMediaController,
|
||||||
AdminSettingsController
|
AdminSettingsController,
|
||||||
|
AdminSupportController
|
||||||
};
|
};
|
||||||
use App\Util\Lexer\PrettyNumber;
|
use App\Util\Lexer\PrettyNumber;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
|
@ -101,7 +102,7 @@ class AdminController extends Controller
|
||||||
$col = $request->query('col') ?? 'id';
|
$col = $request->query('col') ?? 'id';
|
||||||
$dir = $request->query('dir') ?? 'desc';
|
$dir = $request->query('dir') ?? 'desc';
|
||||||
$stats = $this->collectUserStats($request);
|
$stats = $this->collectUserStats($request);
|
||||||
$users = User::withCount('statuses')->orderBy($col, $dir)->paginate(10);
|
$users = User::withCount('statuses')->orderBy($col, $dir)->simplePaginate(10);
|
||||||
|
|
||||||
return view('admin.users.home', compact('users', 'stats'));
|
return view('admin.users.home', compact('users', 'stats'));
|
||||||
}
|
}
|
||||||
|
@ -115,7 +116,7 @@ class AdminController extends Controller
|
||||||
|
|
||||||
public function statuses(Request $request)
|
public function statuses(Request $request)
|
||||||
{
|
{
|
||||||
$statuses = Status::orderBy('id', 'desc')->paginate(10);
|
$statuses = Status::orderBy('id', 'desc')->simplePaginate(10);
|
||||||
|
|
||||||
return view('admin.statuses.home', compact('statuses'));
|
return view('admin.statuses.home', compact('statuses'));
|
||||||
}
|
}
|
||||||
|
@ -207,11 +208,11 @@ class AdminController extends Controller
|
||||||
$order = $request->input('order') ?? 'desc';
|
$order = $request->input('order') ?? 'desc';
|
||||||
$limit = $request->input('limit') ?? 12;
|
$limit = $request->input('limit') ?? 12;
|
||||||
if($search) {
|
if($search) {
|
||||||
$profiles = Profile::select('id','username')->where('username','like', "%$search%")->orderBy('id','desc')->paginate($limit);
|
$profiles = Profile::select('id','username')->where('username','like', "%$search%")->orderBy('id','desc')->simplePaginate($limit);
|
||||||
} else if($filter && $order) {
|
} else if($filter && $order) {
|
||||||
$profiles = Profile::select('id','username')->withCount(['likes','statuses','followers'])->orderBy($filter, $order)->paginate($limit);
|
$profiles = Profile::select('id','username')->withCount(['likes','statuses','followers'])->orderBy($filter, $order)->simplePaginate($limit);
|
||||||
} else {
|
} else {
|
||||||
$profiles = Profile::select('id','username')->orderBy('id','desc')->paginate($limit);
|
$profiles = Profile::select('id','username')->orderBy('id','desc')->simplePaginate($limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('admin.profiles.home', compact('profiles'));
|
return view('admin.profiles.home', compact('profiles'));
|
||||||
|
|
Loading…
Reference in a new issue