Improve list level unsubscribe stats

We want to show admin how many subscribers subscribed to a list and how many
unsubscribed within last 30 days so that they see the change.
If someone subscribed and also unsubscribed within those 30 days we skip him.
We don't have data to detect they were really subscribed at some point.
[MAILPOET-4828]
This commit is contained in:
Rostislav Wolny
2023-01-27 10:49:00 +01:00
committed by Aschepikov
parent e3897fa04e
commit 9e157da66d
2 changed files with 4 additions and 1 deletions

View File

@@ -432,6 +432,7 @@ class SubscribersRepository extends Repository {
->join('ss.subscriber', 's')
->join('ss.segment', 'seg')
->where('ss.updatedAt > :date')
->where('ss.createdAt < :date') // ignore those who subscribed and unsubscribed within the date range
->andWhere('s.status = :status')
->andWhere('ss.status = :segment_status')
->andWhere('s.deletedAt IS NULL')