BUGFIX: Make WithinRangeFilter work with dates and related columns.

This commit is contained in:
Sam Minnee 2012-05-18 13:19:20 +12:00
parent 6bb1218760
commit 7036abbd75

View File

@ -26,8 +26,9 @@ class WithinRangeFilter extends SearchFilter {
} }
function apply(DataQuery $query) { function apply(DataQuery $query) {
$this->model = $query->applyRelation($this->relation);
$query->where(sprintf( $query->where(sprintf(
"%s >= %s AND %s <= %s", "%s >= '%s' AND %s <= '%s'",
$this->getDbName(), $this->getDbName(),
Convert::raw2sql($this->min), Convert::raw2sql($this->min),
$this->getDbName(), $this->getDbName(),