@@ -283,11 +283,24 @@ private function addConditions(QueryInterface &$query, ParameterBag $parameters)
283283 }
284284
285285 if (!empty ($ parameters ->get ('living_area ' ))) {
286- $ min = isset ($ parameters ->get ('living_area ' )[0 ]) ? (int ) $ parameters ->get ('living_area ' )[0 ] : 0 ;
287- $ max = isset ($ parameters ->get ('living_area ' )[1 ]) ? (int ) $ parameters ->get ('living_area ' )[1 ] : 5000 ;
288- $ baseConditionGroup ->addCondition ('living_area ' , [$ min , $ max ], 'BETWEEN ' );
286+ $ min = isset ($ parameters ->get ('living_area ' )[0 ]) && $ parameters ->get ('living_area ' )[0 ] !== ""
287+ ? (int ) $ parameters ->get ('living_area ' )[0 ]
288+ : null ;
289+ $ max = isset ($ parameters ->get ('living_area ' )[1 ]) && $ parameters ->get ('living_area ' )[1 ] !== ""
290+ ? (int ) $ parameters ->get ('living_area ' )[1 ]
291+ : null ;
292+
293+ if ($ min !== null && $ max !== null ) {
294+ $ baseConditionGroup ->addCondition ('living_area ' , [$ min , $ max ], 'BETWEEN ' );
295+ } elseif ($ min !== null ) {
296+ $ baseConditionGroup ->addCondition ('living_area ' , [$ min , 99999 ], 'BETWEEN ' );
297+ } elseif ($ max !== null ) {
298+ $ baseConditionGroup ->addCondition ('living_area ' , [0 , $ max ], 'BETWEEN ' );
299+ }
289300 }
290301
302+
303+
291304 // @todo Debt free sales price won't be needed in future.
292305 if ($ value = $ parameters ->get ('debt_free_sales_price ' )) {
293306 if (!$ parameters ->get ('price ' )) {
0 commit comments