chore: snapshot notifications hardening and css/docs alignment

This commit is contained in:
2026-03-20 00:05:03 +01:00
parent fb6e30a062
commit 60c27e50cb
41 changed files with 1862 additions and 254 deletions

View File

@@ -85,6 +85,33 @@ class UserTenantRepository implements UserTenantRepositoryInterface
return $result;
}
/** @return list<int> */
public function listActiveUserIdsByTenantId(int $tenantId): array
{
if ($tenantId <= 0) {
return [];
}
$rows = DB::select(
'select ut.user_id from user_tenants ut join users u on u.id = ut.user_id and u.active = 1 where ut.tenant_id = ?',
(string) $tenantId
);
if (!is_array($rows)) {
return [];
}
$ids = [];
foreach ($rows as $row) {
$data = $row['user_tenants'] ?? $row;
if (is_array($data) && isset($data['user_id'])) {
$ids[] = (int) $data['user_id'];
}
}
return array_values(array_unique($ids));
}
private function extractIntField(array $row, string $field): int
{
foreach ($row as $value) {