вкладка для ботов в админке
This commit is contained in:
@@ -20,9 +20,29 @@ class AccountController extends Controller
|
||||
): View
|
||||
{
|
||||
$search = trim((string) $request->query('search', ''));
|
||||
$searchTerm = $search !== '' ? $search : null;
|
||||
$activeTab = (string) $request->query('tab', AzerothCoreAccountService::ACCOUNT_TAB_PLAYERS);
|
||||
|
||||
if (! in_array($activeTab, [AzerothCoreAccountService::ACCOUNT_TAB_PLAYERS, AzerothCoreAccountService::ACCOUNT_TAB_BOTS], true)) {
|
||||
$activeTab = AzerothCoreAccountService::ACCOUNT_TAB_PLAYERS;
|
||||
}
|
||||
|
||||
$accountStats = $accounts->accountTypeStats($searchTerm);
|
||||
|
||||
return view('admin.accounts.index', [
|
||||
'accounts' => $accounts->listAccounts($search !== '' ? $search : null),
|
||||
'accounts' => $accounts->listAccounts($searchTerm, $activeTab),
|
||||
'accountStats' => $accountStats,
|
||||
'accountTabs' => [
|
||||
AzerothCoreAccountService::ACCOUNT_TAB_PLAYERS => [
|
||||
'label' => 'Игроки',
|
||||
'count' => $accountStats[AzerothCoreAccountService::ACCOUNT_TAB_PLAYERS] ?? 0,
|
||||
],
|
||||
AzerothCoreAccountService::ACCOUNT_TAB_BOTS => [
|
||||
'label' => 'Боты',
|
||||
'count' => $accountStats[AzerothCoreAccountService::ACCOUNT_TAB_BOTS] ?? 0,
|
||||
],
|
||||
],
|
||||
'activeTab' => $activeTab,
|
||||
'inviteCodes' => $inviteCodes->latest(),
|
||||
'inviteStats' => $inviteCodes->stats(),
|
||||
'search' => $search,
|
||||
|
||||
Reference in New Issue
Block a user