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) {
$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() {