_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', '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); } }