Refactor Statistics Entities to use association

[MAILPOET-3069]
This commit is contained in:
Pavel Dohnal
2020-08-05 14:55:38 +02:00
committed by Veljko V
parent 79b26e6ace
commit c1c5885398
8 changed files with 54 additions and 33 deletions

View File

@@ -132,7 +132,7 @@ class NewsletterStatisticsRepository extends Repository {
private function getStatisticCounts(string $statisticsEntityName, array $newsletters): array {
$results = $this->entityManager->createQueryBuilder()
->select('IDENTITY(stats.newsletter) AS id, COUNT(DISTINCT stats.subscriberId) as cnt')
->select('IDENTITY(stats.newsletter) AS id, COUNT(DISTINCT stats.subscriber) as cnt')
->from($statisticsEntityName, 'stats')
->where('stats.newsletter IN (:newsletters)')
->groupBy('stats.newsletter')