_select) { return $this->_select; } $select = parent::getListSelect(); $select->joinLeft($this->_getPair('PartnerGroup', 'pg'), '`pg`.`id` = `p`.`groupId`', [ 'groupTitle' => 'IFNULL(`pg`.`title`, "Other Sponsors")', ]); return $select; } protected function _applySelectOptions(Zend_Db_Select $select, array $options = []) { if (array_key_exists('order', $options)) { switch ($options['order']) { case 'sorter': $options['order'] = ['IFNULL(pg.sorter, 2147483647)', 'p.sorter']; break; case 'sorter DESC': $options['order'] = ['IFNULL(pg.sorter, 2147483647) DESC', 'p.sorter DESC']; break; } } return parent::_applySelectOptions($select, $options); } }