This commit is contained in:
2026-10-03 14:33:08 +04:00
parent 6a73d760c4
commit 93a9442e1c
67 changed files with 941 additions and 698 deletions
@@ -5,7 +5,7 @@ namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Concerns\BuildsPortalProps;
use App\Http\Controllers\Controller;
use App\Http\Requests\UpdateAccountAccessRequest;
use App\Services\AzerothCoreAccountService;
use App\Services\VMangosAccountService;
use App\Services\InviteCodeService;
use App\Support\WowData;
use Illuminate\Http\RedirectResponse;
@@ -19,15 +19,15 @@ class AccountController extends Controller
public function index(
Request $request,
AzerothCoreAccountService $accounts,
VMangosAccountService $accounts,
InviteCodeService $inviteCodes,
): Response {
$search = trim((string) $request->query('search', ''));
$searchTerm = $search !== '' ? $search : null;
$activeTab = (string) $request->query('tab', AzerothCoreAccountService::ACCOUNT_TAB_PLAYERS);
$activeTab = (string) $request->query('tab', VMangosAccountService::ACCOUNT_TAB_PLAYERS);
if (! in_array($activeTab, [AzerothCoreAccountService::ACCOUNT_TAB_PLAYERS, AzerothCoreAccountService::ACCOUNT_TAB_BOTS], true)) {
$activeTab = AzerothCoreAccountService::ACCOUNT_TAB_PLAYERS;
if (! in_array($activeTab, [VMangosAccountService::ACCOUNT_TAB_PLAYERS, VMangosAccountService::ACCOUNT_TAB_BOTS], true)) {
$activeTab = VMangosAccountService::ACCOUNT_TAB_PLAYERS;
}
$accountStats = $accounts->accountTypeStats($searchTerm);
@@ -60,13 +60,13 @@ class AccountController extends Controller
'accounts' => $accountItems,
'accountStats' => $accountStats,
'accountTabs' => [
AzerothCoreAccountService::ACCOUNT_TAB_PLAYERS => [
VMangosAccountService::ACCOUNT_TAB_PLAYERS => [
'label' => 'Игроки',
'count' => $accountStats[AzerothCoreAccountService::ACCOUNT_TAB_PLAYERS] ?? 0,
'count' => $accountStats[VMangosAccountService::ACCOUNT_TAB_PLAYERS] ?? 0,
],
AzerothCoreAccountService::ACCOUNT_TAB_BOTS => [
VMangosAccountService::ACCOUNT_TAB_BOTS => [
'label' => 'Боты',
'count' => $accountStats[AzerothCoreAccountService::ACCOUNT_TAB_BOTS] ?? 0,
'count' => $accountStats[VMangosAccountService::ACCOUNT_TAB_BOTS] ?? 0,
],
],
'activeTab' => $activeTab,
@@ -85,7 +85,7 @@ class AccountController extends Controller
]);
}
public function updateAccess(int $accountId, UpdateAccountAccessRequest $request, AzerothCoreAccountService $accounts): RedirectResponse
public function updateAccess(int $accountId, UpdateAccountAccessRequest $request, VMangosAccountService $accounts): RedirectResponse
{
abort_unless($accounts->findUserById($accountId), 404);