Show only default segments in listings
[PREMIUM-38]
This commit is contained in:
@ -152,6 +152,7 @@ class Segment extends Model {
|
||||
|
||||
static function getSegmentsWithSubscriberCount($type = self::TYPE_DEFAULT) {
|
||||
$query = self::selectMany(array(self::$_table.'.id', self::$_table.'.name'))
|
||||
->whereIn('type', array(Segment::TYPE_WP_USERS, Segment::TYPE_DEFAULT))
|
||||
->selectExpr(
|
||||
self::$_table.'.*, ' .
|
||||
'COUNT(IF('.
|
||||
@ -209,6 +210,13 @@ class Segment extends Model {
|
||||
)->findArray();
|
||||
}
|
||||
|
||||
static function listingQuery(array $data = array()) {
|
||||
$query = self::select('*');
|
||||
$query->whereIn('type', array(Segment::TYPE_WP_USERS, Segment::TYPE_DEFAULT));
|
||||
return $query
|
||||
->filter('groupBy', $data);
|
||||
}
|
||||
|
||||
static function createOrUpdate($data = array()) {
|
||||
$segment = false;
|
||||
|
||||
|
Reference in New Issue
Block a user