Fix subscribers' segment filter
[MAILPOET-4563]
This commit is contained in:
@@ -260,9 +260,7 @@ class SubscriberListingRepository extends ListingRepository {
|
||||
$queryBuilder
|
||||
->select('s')
|
||||
->from(SegmentEntity::class, 's');
|
||||
if ($group === 'trash') {
|
||||
$queryBuilder->andWhere('s.deletedAt IS NOT NULL');
|
||||
} else {
|
||||
if ($group !== 'trash') {
|
||||
$queryBuilder->andWhere('s.deletedAt IS NULL');
|
||||
}
|
||||
|
||||
@@ -285,9 +283,13 @@ class SubscriberListingRepository extends ListingRepository {
|
||||
} else {
|
||||
$count = $this->subscribersCountsController->getSegmentStatisticsCount($segment);
|
||||
}
|
||||
|
||||
$subscribersCount = (float)$count[$key];
|
||||
// filter segments without subscribers
|
||||
if (!$subscribersCount) {
|
||||
continue;
|
||||
}
|
||||
$segmentList[] = [
|
||||
'label' => sprintf('%s (%s)', $segment->getName(), number_format((float)$count[$key])),
|
||||
'label' => sprintf('%s (%s)', $segment->getName(), number_format($subscribersCount)),
|
||||
'value' => $segment->getId(),
|
||||
];
|
||||
}
|
||||
|
Reference in New Issue
Block a user