- Updated AGENTS.md to clarify site admin roles and their associated permissions. - Refactored reconciliation controllers to include admin user validation and improved access control based on admin roles. - Enhanced AdminReconcileJobService to support player-specific reconciliation and site-based job creation. - Removed deprecated rebate commission report functionality from the API and related services. - Improved dashboard overview builders to accommodate new site operator roles and their specific functionalities.
23 lines
535 B
PHP
23 lines
535 B
PHP
<?php
|
|
|
|
namespace App\Services\Admin;
|
|
|
|
use App\Models\AdminSite;
|
|
use App\Models\AdminUser;
|
|
|
|
/** 站点运营仪表盘:解析账号绑定的主接入站点。 */
|
|
final class SiteDashboardSiteResolver
|
|
{
|
|
public static function resolvePrimarySite(AdminUser $admin): ?AdminSite
|
|
{
|
|
$siteIds = $admin->accessibleAdminSiteIds();
|
|
if ($siteIds === null || $siteIds === []) {
|
|
return null;
|
|
}
|
|
|
|
return AdminSite::query()
|
|
->where('id', (int) $siteIds[0])
|
|
->first();
|
|
}
|
|
}
|