$this->selectAdd("
(
- SELECT
- count(user_id)
- FROM
- {$cgm}
- WHERE
- {$this->tableName()}.id = {$cgm->tableName()}.group_id
+ SELECT COUNT(core_group_member.user_id)
+ FROM
+ core_group_member
+ LEFT JOIN
+ core_person
+ 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
- {$cgm->tableName()}.user_id = {$cp->tableName()}.id
+ core_group_member.user_id = core_person.id
AND
- {$cp->tableName()}.active = 1
- )
- AS group_member_count
- ");
-
-
+ 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");
/*$cgmDBObj->joinAdd($cpObj);