From 8df50afc2bcbebed6675dec80b8562fdb6d5fd18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ja=CC=81n=20Mikla=CC=81s=CC=8C?= Date: Wed, 24 Apr 2019 15:13:05 +0200 Subject: [PATCH] Fix counting inactive subscribers in segments list [MAILPOET-2007] --- 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 d6dd3dabe9..679d9708c7 100644 --- a/lib/Models/Segment.php +++ b/lib/Models/Segment.php @@ -99,7 +99,7 @@ class Segment extends Model { ) ->select_expr( 'SUM(CASE WHEN subscribers.status = "' . Subscriber::STATUS_INACTIVE . '" - OR relation.status = "' . Subscriber::STATUS_UNSUBSCRIBED . '" THEN 1 ELSE 0 END)', + AND relation.status != "' . Subscriber::STATUS_UNSUBSCRIBED . '" THEN 1 ELSE 0 END)', Subscriber::STATUS_INACTIVE ) ->select_expr(