_getMembers($ids); foreach ($list as &$item) { if (!empty($members[$item['id']])) { $item['members'] = $members[$item['id']]; } } unset($item); return parent::_prepareList($list); } public function getListSelect() { if (null === $this->_select) { $this->_select = parent::getListSelect(); $this->_select->where('enabled = "y"'); } return $this->_select; } protected function _getMembers(array $leadershipGroupIds = array()) { if (!$leadershipGroupIds) { return []; } $select = $this->_db->select(); $select->from($this->_getPair('User'), [ 'leadershipGroupId', 'id', 'alias', 'photo', 'linkedInUrl', 'leadershipPosition', 'fullestName' => UserModel::getFullestNameDbExpr() ]); $select->where('leadershipGroupId IN (?)', $leadershipGroupIds, Qs_Db::INT_TYPE); $select->where('`status` = ?', UserEntity::STATUS_ACTIVE); $select->order('sorter'); return $this->_db->fetchAll($select, [], Qs_Db::FETCH_GROUP); } public function getListStatement4XmlSitemap($columns = array('alias', 'changed')) { $select = $this->_db->select(); $select->from($this->_getPair('User', 'u'), $columns); $select->join($this->_getPair('LeadershipGroup', 'lg'), '`lg`.`id` = `u`.`leadershipGroupId`', []); $select->where('`u`.`status` = ?', UserEntity::STATUS_ACTIVE); $select->order('lg.sorter'); return $select->query(); } }