From 7c47b8156936664ddc0c2db48defbf77cba272bb Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 2 Apr 2018 17:07:15 +0200 Subject: [PATCH] fixing subscribers count --- lib/Models/Segment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Models/Segment.php b/lib/Models/Segment.php index a6925d27f2..fc20251420 100644 --- a/lib/Models/Segment.php +++ b/lib/Models/Segment.php @@ -190,7 +190,7 @@ class Segment extends Model { '(SELECT segments.id, segments.name, COUNT(relation.subscriber_id) as subscribers ' . 'FROM ' . MP_SUBSCRIBER_SEGMENT_TABLE . ' relation ' . 'LEFT JOIN ' . self::$_table . ' segments ON segments.id = relation.segment_id ' . - 'LEFT JOIN ' . MP_SUBSCRIBERS_TABLE . ' subscribers ON subscribers.id = relation.subscriber_id ' . + 'INNER JOIN ' . MP_SUBSCRIBERS_TABLE . ' subscribers ON subscribers.id = relation.subscriber_id ' . 'WHERE relation.segment_id IS NOT NULL ' . 'AND subscribers.deleted_at IS NULL ' . 'GROUP BY segments.id) ' .