private function filter($search = '') { $res = CompanyModel::LikeSearch($search, $this->region_id, $this->group_id, $this->result_per_page, ($this->page - 1) * $this->result_per_page); if (SQL::Count() == 0 and $this->group_id + $this->region_id > 0 and $search != '') { $this->region_id = 0; $this->group_id = 0; $res = CompanyModel::search($search, 0, 0, $this->page, ($this->page - 1) * $this->result_per_page); if (SQL::Count() > 0) { Site::Message('Мы не нашли ничего в выбранных вами группах, но похоже что-то нашлось тут.'); } } return $res; }