Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ENHANCEMENT: GreaterThanFilter should be consistent with LessThanFilter

Numeric or float values weren't supported.
  • Loading branch information...
commit 66dfa38d0a3f4dcd1f06e80e4e0e35a48d93bfea 1 parent e0e9634
@unclecheese unclecheese authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 search/filters/GreaterThanFilter.php
View
11 search/filters/GreaterThanFilter.php
@@ -14,11 +14,12 @@ class GreaterThanFilter extends SearchFilter {
*/
public function apply(DataQuery $query) {
$this->model = $query->applyRelation($this->relation);
- return $query->where(sprintf(
- "%s > '%s'",
- $this->getDbName(),
- Convert::raw2sql($this->getDbFormattedValue())
- ));
+ $value = $this->getDbFormattedValue();
+
+ if(is_numeric($value)) $filter = sprintf("%s > %s", $this->getDbName(), Convert::raw2sql($value));
+ else $filter = sprintf("%s > '%s'", $this->getDbName(), Convert::raw2sql($value));
+
+ return $query->where($filter);
}
public function isEmpty() {
Please sign in to comment.
Something went wrong with that request. Please try again.