mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
ENHANCEMENT: GreaterThanFilter should be consistent with LessThanFilter
Numeric or float values weren't supported.
This commit is contained in:
parent
e0e96343cf
commit
66dfa38d0a
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user