/** * Generate filter conditions for filter search * @param string filter * @param string pre character for search (default '') optional '%' */ public function generateFilterConditions($filter = null, $pre = '') { $conditions = parent::generateFilterConditions($filter, $pre); foreach ($this->_statuses as $key => $name) { if (strtolower($filter) == $name) { $conditions['OR']["{$this->alias}.status"] = $key; unset($conditions['OR']["{$this->alias}.status LIKE"]); } } foreach ($this->_types as $key => $name) { if (strtolower($filter) == $name) { $conditions['OR']["{$this->alias}.type"] = $key; unset($conditions['OR']["{$this->alias}.type LIKE"]); } } }