mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Use numeric literal for numeric less-than filter.
This commit is contained in:
parent
0bdfc0c515
commit
fece61c90b
@ -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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user