Fatal error: Uncaught Orm_Exception: Incorrect DATE value: '0000-00-00' (SELECT DISTINCT(t.id),t.*,(select count(ad_id) from vlasne.estate_periods_free where ad_id = t.id and( ('2024-10-06' <= DATE_FORMAT(end_period,'%Y-%m-%d') AND '2024-10-06' >= DATE_FORMAT(start_period,'%Y-%m-%d') ) OR ('2024-10-06' <= DATE_FORMAT(end_period,'%Y-%m-%d') AND '2024-10-06' >= DATE_FORMAT(start_period,'%Y-%m-%d') ))) as free_now, IF( (end_hot_2 IS NULL OR city_hot_paused IS NOT NULL OR end_hot_2 ="0000-00-00")AND (end_hot IS NULL OR city_hot_paused IS NOT NULL OR end_hot ="0000-00-00") ,0, IF(IF(end_hot_2 is null,"2010-01-01",end_hot_2) < DATE_FORMAT(NOW(),"%Y-%m-%d") AND DATE_FORMAT((IF (end_hot IS NULL , "2010-01-01", end_hot)),"%Y-%m-%d") < DATE_FORMAT(NOW(),"%Y-%m-%d") ,0,1) ) as HOT, CEILING( if ( (select count(*) from vlasne.periods_prices where ad_id = t.id and DATE_FORMAT(NOW(),"%Y-%m-%d")>= date_start and DATE_FORMAT(NOW(),"%Y-%m-%d") <= date_end AND price_usd >0 AND type != 2) = 1, ( (CEILING( IF (currency = 6, (select price_uah from vlasne.periods_prices where ad_id = t.id and DATE_FORMAT(NOW(),"%Y-%m-%d")>= date_start and DATE_FORMAT(NOW(),"%Y-%m-%d") <= date_end limit 1), IF (currency = 3, (select price_rub from vlasne.periods_prices where ad_id = t.id and DATE_FORMAT(NOW(),"%Y-%m-%d")>= date_start and DATE_FORMAT(NOW(),"%Y-%m-%d") <= date_end limit 1)*0.60353, IF ( currency = 2,(select price_usd from vlasne.periods_prices where ad_id = t.id and DATE_FORMAT(NOW(),"%Y-%m-%d")>= date_start and DATE_FORMAT(NOW(),"%Y-%m-%d") <= date_end limit 1)*41.2202, IF (currency = 1, (select price_eur from vlasne.periods_prices where ad_id = t.id and DATE_FORMAT(NOW(),"%Y-%m-%d")>= date_start and DATE_FORMAT(NOW(),"%Y-%m-%d") <= date_end limit 1)* 45.5236, IF (currency = 7, (select price_kzt from vlasne.periods_prices where ad_id = t.id and DATE_FORMAT(NOW(),"%Y-%m-%d")>= date_start and DATE_FORMAT(NOW(),"%Y-%m-%d") <= date_end limit 1)* 0.0854,0) ) ) )) )) ) , IF (currency = 6, t.price_uah, IF (currency = 3, t.price_rub*0.60353, IF ( currency = 2, t.price_usd*41.2202, IF (currency = 1, t.price_eur* 45.5236, IF (currency = 7, t.price_kzt* 0.0854,0) ) ) ) )) ) as super_price FROM vlasne.estate_ad t LEFT JOIN vlasne.periods_prices ON t.id = periods_prices.ad_id WHERE public = 1 AND parked = 0 AND unpaid = 0 AND on_roomer = 1 AND city_id=9967 AND ( ( ( end_public >= "2024-10-06 00:00:00" AND city_public_paused IS NULL )) OR ( end_hot >= "2024-10-06 00:00:00" AND set_end_hot = 1 AND city_public_paused IS NULL ) OR ( on_home_end >= "2024-10-06 00:00:00" AND onhome = 1 AND city_public_paused IS NULL ) AND onhomepaused IS NULL AND hot_paused IS NULL ) AND name like "%апартамент%" ORDER BY daily_fee_paid DESC, hot DESC, super_price ASC LIMIT 0,30; - EstateAd) in /home/forge/roomer.kiev.ua/Framework2.0/packages/Orm/Statement.php:119 Stack trace: #0 /home/forge/roomer.kiev.ua/Framework2.0/packages/Orm/Statement.php(187): Orm_Statement->execute() #1 /home/forge/roomer.kiev.ua/Framework2.0/packages/Orm/ActiveRecord.php(442): Orm_Statement->getResults() #2 /home/forge/roomer.kiev.ua/application/controllers/SearchController.php(832): Orm_ActiveRecord->findByQuery() #3 /home/forge/roomer.kiev.ua/application/controllers/SearchController.php(17): SearchController->resultAction() #4 /home/forge/roomer.kiev.ua/Framework2.0/libraries/Controller.php(67): SearchController->indexAction() #5 /home/forge/roomer.kiev.ua/index.php(393): Controller::process() #6 {main} thrown in /home/forge/roomer.kiev.ua/Framework2.0/packages/Orm/Statement.php on line 119