Skip to content

Commit

Permalink
Fix report
Browse files Browse the repository at this point in the history
  • Loading branch information
a-menshchikov committed Sep 8, 2024
1 parent 708b58b commit 6d26d7a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions shared/homeless/src/Service/ReportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ private function completedItems(
'excludeStatuses' => $excludeStatuses,
'dateFrom' => $dateFrom ?: '1960-01-01',
'dateTo' => $dateTo ?: date('Y-m-d'),
], [
'excludeStatuses' => ArrayParameterType::INTEGER,
])->fetchAllNumeric();
}

Expand Down Expand Up @@ -659,17 +661,19 @@ private function aggregated2(
unset($clientsIds[$clientsId]);
}
}
$clientsIds = array_keys($clientsIds);
}
if ($clientsIds === []) {
return [];
}
$stmt = $this->entityManager->getConnection()->prepare('

return $this->entityManager->getConnection()->executeQuery('
SELECT COUNT(*)
FROM client c
WHERE c.id IN ('.implode(',', $clientsIds).')
');

return $stmt->executeQuery()->fetchAllNumeric();
WHERE c.id IN (:clientsIds)
', [
'clientsIds' => array_keys($clientsIds),
], [
'clientsIds' => ArrayParameterType::INTEGER,
])->fetchAllNumeric();
}
}

0 comments on commit 6d26d7a

Please sign in to comment.