MYSQL ERROR
Error:Not unique table/alias: 'TDF_units'
Query:SELECT SQL_CALC_FOUND_ROWS `T1`.*, `T3`.`Path` AS `Path`, `T3`.`Key` AS `Key`, `T3`.`Type` AS `Listing_type`, `T3`.`Parent_keys`, IF( `T1`.`Sub_status`='invisible' OR `T1`.`Sub_status` = 'visible', `T1`.`Main_photo`, IF(`T1`.`Main_photo`='',`T1`.`Main_photo`,CONCAT( SUBSTRING_INDEX(`T1`.`Main_photo`, '.', 1), '_', `T1`.`Sub_status` ,'_tr', '.', SUBSTRING_INDEX(`T1`.`Main_photo`, '.', -1)))) AS `Main_photo` ,IF(`T1`.`Date` != `T1`.`HighlightDate` AND `T1`.`HighlightDate` != '0000-00-00 00:00:00', '1', '0') as 'is_highlighted', IF(`T1`.`Featured_date`, '1', '0') `Featured` FROM `fl_listings` AS `T1` LEFT JOIN `fl_categories` AS `T3` ON `T1`.`Category_ID` = `T3`.`ID` LEFT JOIN `fl_data_formats` AS `TDF_units` ON `TDF_units`.`Key` = SUBSTRING_INDEX(`T1`.`square_feet`, '|', -1) LEFT JOIN `fl_data_formats` AS `TDF_units` ON `TDF_units`.`Key` = SUBSTRING_INDEX(`T1`.`lot_size`, '|', -1) WHERE `T1`.`Status` = 'active' AND `T1`.`Category_ID` = 18 AND (ROUND(`T1`.`bathrooms`, 2) >= 4 AND ROUND(`T1`.`bathrooms`, 2) <= 5) AND (ROUND(`T1`.`price`, 2) >= 120001 AND ROUND(`T1`.`price`, 2) <= 100000000) AND `T1`.`Category_ID` = 18 AND `T1`.`Sub_status` <> 'invisible' ORDER BY `Featured` DESC , SUBSTRING_INDEX(`T1`.`lot_size`, '|', 1)/IF(`TDF_units`.`Rate` IS NULL, 1, `TDF_units`.`Rate`) ASC LIMIT 0, 12
Function:getAll
Class:rlDatabase
File:/home/nekretnine365/public_html/includes/classes/rlListings.class.php (line# 721)