+ SELECT COUNT(${cgm}.user_id)
+ FROM
+ {$cgm}
+ LEFT JOIN
+ {$cp}
+ ON
+ ${cp}.id = {$cgm}.user_id
+ WHERE
+ ${cgm}.group_id = {$this->tableName()}.id
+ AND
+ ${cp}.active = 1
+ ) AS group_member_count
+ ");
+
+ /*WHERE
+ {$this->tableName()}.id = core_group_member.group_id
+ AND
+ core_group_member.user_id = core_person.id
+ AND
+ core_person.active = 1
+ )*/
+
+// $this->whereAdd("{$this->tableName()}.id = core_group_member.group_id");
+// $this->whereAdd("core_group_member.user_id = core_person.id");
+// $this->whereAdd("core_person.active = 1");