Add engagement score to the homepage subscribers stats

[MAILPOET-4828]
This commit is contained in:
Rostislav Wolny
2023-01-20 09:39:24 +01:00
committed by Aschepikov
parent 50a377b749
commit 076f79358e
6 changed files with 30 additions and 2 deletions

View File

@ -402,7 +402,7 @@ class SubscribersRepository extends Repository {
public function getListLevelCountsOfSubscribedAfter(\DateTimeInterface $date): array {
$data = $this->entityManager->createQueryBuilder()
->select('seg.id, seg.name, seg.type, COUNT(ss.id) as count')
->select('seg.id, seg.name, seg.type, seg.averageEngagementScore, COUNT(ss.id) as count')
->from(SubscriberSegmentEntity::class, 'ss')
->join('ss.subscriber', 's')
->join('ss.segment', 'seg')
@ -422,7 +422,7 @@ class SubscribersRepository extends Repository {
public function getListLevelCountsOfUnsubscribedAfter(\DateTimeInterface $date): array {
return $this->entityManager->createQueryBuilder()
->select('seg.id, seg.name, seg.type, COUNT(ss.id) as count')
->select('seg.id, seg.name, seg.type, seg.averageEngagementScore, COUNT(ss.id) as count')
->from(SubscriberSegmentEntity::class, 'ss')
->join('ss.subscriber', 's')
->join('ss.segment', 'seg')