BUGFIX: Use numeric literal for numeric less-than filter.

This commit is contained in:
Sam Minnee 2011-12-17 16:32:45 +13:00
parent 0bdfc0c515
commit fece61c90b

View File

@ -14,11 +14,12 @@ class LessThanFilter 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() {