feat: enhance admin role management and reconciliation features
- 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.
This commit is contained in:
36
app/Services/Admin/SiteSettlementBillStats.php
Normal file
36
app/Services/Admin/SiteSettlementBillStats.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Admin;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
/** 站点信用账期账单摘要(待确认 / 待收付)。 */
|
||||
final class SiteSettlementBillStats
|
||||
{
|
||||
/**
|
||||
* @return array{
|
||||
* pending_confirm_count: int,
|
||||
* payable_count: int,
|
||||
* payable_unpaid_minor: int
|
||||
* }
|
||||
*/
|
||||
public static function forSite(int $siteId): array
|
||||
{
|
||||
$pendingConfirmQuery = DB::table('settlement_bills as sb')
|
||||
->join('settlement_periods as sp', 'sp.id', '=', 'sb.settlement_period_id')
|
||||
->where('sp.admin_site_id', $siteId)
|
||||
->where('sb.status', 'pending_confirm');
|
||||
|
||||
$payableQuery = DB::table('settlement_bills as sb')
|
||||
->join('settlement_periods as sp', 'sp.id', '=', 'sb.settlement_period_id')
|
||||
->where('sp.admin_site_id', $siteId)
|
||||
->whereIn('sb.status', ['confirmed', 'partial_paid', 'overdue'])
|
||||
->where('sb.unpaid_amount', '>', 0);
|
||||
|
||||
return [
|
||||
'pending_confirm_count' => (int) (clone $pendingConfirmQuery)->count(),
|
||||
'payable_count' => (int) (clone $payableQuery)->count(),
|
||||
'payable_unpaid_minor' => (int) (clone $payableQuery)->sum('sb.unpaid_amount'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user