Fix counting segments
[MAILPOET-2882]
This commit is contained in:
@ -218,6 +218,7 @@ class Segment extends Model {
|
|||||||
|
|
||||||
public static function groups() {
|
public static function groups() {
|
||||||
$allQuery = Segment::getPublished();
|
$allQuery = Segment::getPublished();
|
||||||
|
$allQuery->whereNotEqual('type', DynamicSegment::TYPE_DYNAMIC);
|
||||||
if (!Segment::shouldShowWooCommerceSegment()) {
|
if (!Segment::shouldShowWooCommerceSegment()) {
|
||||||
$allQuery->whereNotEqual('type', self::TYPE_WC_USERS);
|
$allQuery->whereNotEqual('type', self::TYPE_WC_USERS);
|
||||||
}
|
}
|
||||||
@ -230,7 +231,9 @@ class Segment extends Model {
|
|||||||
[
|
[
|
||||||
'name' => 'trash',
|
'name' => 'trash',
|
||||||
'label' => WPFunctions::get()->__('Trash', 'mailpoet'),
|
'label' => WPFunctions::get()->__('Trash', 'mailpoet'),
|
||||||
'count' => Segment::getTrashed()->count(),
|
'count' => Segment::getTrashed()
|
||||||
|
->whereNotEqual('type', DynamicSegment::TYPE_DYNAMIC)
|
||||||
|
->count(),
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user