_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 = []) { if (!$leadershipGroupIds) { return []; } $select = $this->_db->select(); $select->from( $this->_getPair('User'), ['leadershipGroupId', 'id', 'alias', 'photo', 'linkedInUrl', 'firstName', 'lastName', 'leadershipPosition'] ) ->where('leadershipGroupId IN (?)', $leadershipGroupIds, Qs_Db::INT_TYPE) ->where('`status` = ?', UserEntity::STATUS_ACTIVE) ->joinLeft($this->_getPair('Company', 'c'), '`c`.`id` = `User`.`companyId`', ['company' => 'c.name']) ->order('sorter'); return $this->_db->fetchAll($select, [], Qs_Db::FETCH_GROUP); } public function getListStatement4XmlSitemap($columns = ['alias']) { $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(); } }