Merge pull request #730 from unclecheese/patch-9

ENHANCEMENT: GreaterThanFilter should be consistent with LessThanFilter
This commit is contained in:
Sam Minnée 2012-08-21 12:44:20 -07:00
commit af2eae760f

View File

@ -14,11 +14,12 @@ class GreaterThanFilter extends SearchFilter {
*/ */
public function apply(DataQuery $query) { public function apply(DataQuery $query) {
$this->model = $query->applyRelation($this->relation); $this->model = $query->applyRelation($this->relation);
return $query->where(sprintf( $value = $this->getDbFormattedValue();
"%s > '%s'",
$this->getDbName(), if(is_numeric($value)) $filter = sprintf("%s > %s", $this->getDbName(), Convert::raw2sql($value));
Convert::raw2sql($this->getDbFormattedValue()) else $filter = sprintf("%s > '%s'", $this->getDbName(), Convert::raw2sql($value));
));
return $query->where($filter);
} }
public function isEmpty() { public function isEmpty() {