Fixed always setting unit_count filter to 0
This commit is contained in:
@@ -130,7 +130,7 @@
|
||||
<label class="form-label" for="filter_unit_count">Anzahl GWR Wohneinheiten</label>
|
||||
<select name="filter[unit_count]" id="filter_unit_count" class="form-control">
|
||||
<option value=""></option>
|
||||
<option value="0" <?=(isset($filter) && array_key_exists("unit_count", $filter) && intval($filter['unit_count']) === 0) ? "selected='selected'" : ""?>>0</option>
|
||||
<option value="0" <?=(isset($filter) && array_key_exists("unit_count", $filter) && strlen($filter['unit_count']) && intval($filter['unit_count']) === 0) ? "selected='selected'" : ""?>>0</option>
|
||||
<option value="1" <?=(isset($filter) && array_key_exists("unit_count", $filter) && intval($filter['unit_count']) === 1) ? "selected='selected'" : ""?>>1</option>
|
||||
<option value="2" <?=(isset($filter) && array_key_exists("unit_count", $filter) && intval($filter['unit_count']) === 2) ? "selected='selected'" : ""?>> > 1</option>
|
||||
</select>
|
||||
|
||||
@@ -474,7 +474,7 @@ class PreorderModel {
|
||||
$where .= " AND adb_hausnummer.unit_count = 1";
|
||||
} elseif(intval($unit_count) === 2) {
|
||||
$where .= " AND adb_hausnummer.unit_count > 1";
|
||||
} elseif(intval($unit_count) === 0) {
|
||||
} elseif(strlen($unit_count) && intval($unit_count) === 0) {
|
||||
$where .= " AND adb_hausnummer.unit_count = 0 OR adb_hausnummer.unit_count IS NULL";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user