Update: 2026-05-04 21:54:02
This commit is contained in:
@@ -15,7 +15,13 @@ if ($decoded['role'] !== 'super_admin') {
|
||||
$db = Database::getInstance();
|
||||
|
||||
try {
|
||||
$stmt = $db->query("SELECT id, name, email, phone, status, created_at FROM tenants ORDER BY created_at DESC");
|
||||
$stmt = $db->query("
|
||||
SELECT t.id, t.name, t.email, t.phone, t.status, t.created_at,
|
||||
(SELECT COUNT(*) FROM companies WHERE tenant_id = t.id) as companies_count,
|
||||
(SELECT COUNT(*) FROM invoices WHERE tenant_id = t.id) as invoices_count
|
||||
FROM tenants t
|
||||
ORDER BY t.created_at DESC
|
||||
");
|
||||
$tenants = $stmt->fetchAll();
|
||||
|
||||
foreach ($tenants as &$t) {
|
||||
|
||||
Reference in New Issue
Block a user