Added less, less or equal, greater or greater or equal to as search filter options

pull/352/head
Peter Goodhall 2019-09-14 18:00:41 +01:00
rodzic c80f769a7c
commit de95ae64b7
1 zmienionych plików z 32 dodań i 0 usunięć

Wyświetl plik

@ -88,6 +88,38 @@ class Search extends CI_Controller {
} }
} }
if($values['operator'] == "less") {
if($search_type == "AND") {
$this->db->where($values['field'].' <', $name);
} else {
$this->db->or_where($values['field'].' <', $name);
}
}
if($values['operator'] == "less_or_equal") {
if($search_type == "AND") {
$this->db->where($values['field'].' <=', $name);
} else {
$this->db->or_where($values['field'].' <=', $name);
}
}
if($values['operator'] == "greater") {
if($search_type == "AND") {
$this->db->where($values['field'].' >', $name);
} else {
$this->db->or_where($values['field'].' >', $name);
}
}
if($values['operator'] == "greater_or_equal") {
if($search_type == "AND") {
$this->db->where($values['field'].' >=', $name);
} else {
$this->db->or_where($values['field'].' >=', $name);
}
}
} }
} }
} }