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) {
|
static function getSegmentsWithSubscriberCount($type = self::TYPE_DEFAULT) {
|
||||||
$query = self::selectMany(array(self::$_table.'.id', self::$_table.'.name'))
|
$query = self::selectMany(array(self::$_table.'.id', self::$_table.'.name'))
|
||||||
|
->whereIn('type', array(Segment::TYPE_WP_USERS, Segment::TYPE_DEFAULT))
|
||||||
->selectExpr(
|
->selectExpr(
|
||||||
self::$_table.'.*, ' .
|
self::$_table.'.*, ' .
|
||||||
'COUNT(IF('.
|
'COUNT(IF('.
|
||||||
@ -209,6 +210,13 @@ class Segment extends Model {
|
|||||||
)->findArray();
|
)->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()) {
|
static function createOrUpdate($data = array()) {
|
||||||
$segment = false;
|
$segment = false;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user