Streamline calls to orderBy

This commit is contained in:
Shift
2023-03-30 14:15:08 +00:00
parent b8593e22e0
commit 0faefd419b
12 changed files with 19 additions and 19 deletions
@@ -199,7 +199,7 @@ class AdminSiteController extends BasePageController
$usersbymonth = User::getUsersByMonth();
$this->smarty->assign('usersbymonth', $usersbymonth);
$usersbyrole = Role::query()->select(['name'])->withCount('users')->groupBy('name')->having('users_count', '>', 0)->orderBy('users_count', 'desc')->get();
$usersbyrole = Role::query()->select(['name'])->withCount('users')->groupBy('name')->having('users_count', '>', 0)->orderByDesc('users_count')->get();
$this->smarty->assign('usersbyrole', $usersbyrole);
$this->smarty->assign('totusers', 0);
$this->smarty->assign('totrusers', 0);