aktualnie mam coś takiego i wszystko jest ok gdy checkbox jest kliknięty wtedy wartość to title_and_description jednak gdy go odklikam to jest błąd bo nie ma wartości domyślnej.
public function search_phrase($phrase, $where = 'title') { { if($where == 'title' || $where == 'description') { $where = $this->_db->quote_column( $where == 'title' ? "annoucement_title" : "annoucement_content" ); } else { $where = $this->_db->quote_column('"annoucement_title", "annoucement_content"'); } $this->where(DB::expr('MATCH('.$where.')'), "AGAINST", DB::expr("(:phrase IN BOOLEAN MODE)")) ->param(':phrase', $phrase); } else { $phrase = '%'.$phrase.'%'; if($where == 'title') { $this->where('annoucement_title', 'LIKE', $phrase); } elseif($where == 'description') { $this->where('annoucement_content', 'LIKE', $phrase); } else { $this->where_open(); $this->where('annoucement_title', 'LIKE', $phrase); $this->or_where('annoucement_content', 'LIKE', $phrase); $this->where_close(); } } return $this; }
Chodzi o to, że jeżeli checkbox nie jest checked to, żeby $where miało wartość title
może zrobić to na radio i jedną opcje zrobić na hidden?