where("`show`='y'"); return $select; } protected function _getListPositions() { $select = $this->_db->select(); $select->from($this->_getPair(), 'id'); $select->where('`show` = "y"'); if (Qs_Array::get($this->_selectOptions, 'order')) { $select->order($this->_selectOptions['order']); } $positions = $this->_db->fetchCol($select); $positions = array_flip($positions); return $positions; } protected function _prepareSearchList(array &$list, array $providerOptions) { if (!empty($list)) { $positions = $this->_getListPositions(); $testimonialList = new App_Partner_List(array()); $ipp = $testimonialList->getDefaultIpp(); foreach ($list as &$row) { $position = (int) $positions[$row['id']]; $position++; $row['page'] = ceil($position / $ipp); if ($row['url']) { $url = parse_url($row['url']); $row['urlTitle'] = Qs_Text_Mark::markSearchWords($url['host'], $this->_filter['query']) ; } } } return parent::_prepareSearchList($list, $providerOptions); } public function getRandomBanner() { $select = $this->_db->select(); $select->from($this->_getPair($this->_tableAlias)) ->where('bannerShow = ?', 'y') ->order('RAND()') ->limit('1'); return $this->_db->fetchRow($select); } }