🚀 مُصادَق: تحديث برمجي جديد 2026-05-03 14:02

This commit is contained in:
Hamza-Ayed
2026-05-03 14:02:18 +03:00
parent 0e27d96371
commit cb69abe221
8 changed files with 492 additions and 1149 deletions

View File

@@ -33,8 +33,8 @@ final class DashboardController
$stmt->execute($params);
$statusCounts = $stmt->fetchAll();
// 3. Recent Activity
$stmt = $db->prepare("SELECT i.*, c.name as company_name FROM invoices i JOIN companies c ON i.company_id = c.id {$where} ORDER BY i.created_at DESC LIMIT 5");
// 3. Recent Activity - Fixed ambiguity
$stmt = $db->prepare("SELECT i.*, c.name as company_name FROM invoices i JOIN companies c ON i.company_id = c.id WHERE i.tenant_id = ? " . ($role !== 'super_admin' ? " AND i.company_id = ?" : "") . " ORDER BY i.created_at DESC LIMIT 5");
$stmt->execute($params);
$recent = $stmt->fetchAll();