mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-08 18:51:12 +02:00
Merge pull request #730 from unclecheese/patch-9
ENHANCEMENT: GreaterThanFilter should be consistent with LessThanFilter
This commit is contained in:
commit
af2eae760f
@ -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…
Reference in New Issue
Block a user