SELECT  IF (FIND_IN_SET('7728', `T1`.`Crossed`) > 0, 1, 0) AS `Crossed_listing`,  `T1`.*, `T3`.`Key` AS `Key`, `T3`.`Type` AS `Listing_type`, `T3`.`Parent_keys`, `T3`.`Parent_IDs`, `T3`.`Path` AS `Path`, IF (`T1`.`country` = 'countries_mexico' AND `T1`.`country_level1` = 'countries_mexico_jalisco' AND `T1`.`country_level2` = 'countries_mexico_jalisco_quitupan' , 1, 0) AS `mf_filter_match`, IF(`T1`.`country` = 'countries_mexico' AND `T1`.`country_level1` = 'countries_mexico_jalisco' AND `T1`.`country_level2` = 'countries_mexico_jalisco_quitupan' , 0, (3956 * 2 * ASIN(SQRT(POWER(SIN((19.85 - `T1`.`Loc_latitude`) * 0.0174532925 / 2), 2) + COS(19.85 * 0.0174532925) * COS(`T1`.`Loc_latitude` * 0.0174532925) * POWER(SIN((-102.8333 - `T1`.`Loc_longitude`) * 0.0174532925 / 2), 2))))) AS `mf_distance`, IF(`T1`.`Date` != `T1`.`HighlightDate` AND `T1`.`HighlightDate` != '0000-00-00 00:00:00', '1', '0') as 'is_highlighted', IF(`T1`.`Featured_date` IS NOT NULL, '1', '0') `Featured` FROM `{db_prefix}listings` AS `T1` LEFT JOIN `{db_prefix}categories` AS `T3` ON `T1`.`Category_ID` = `T3`.`ID` WHERE `T1`.`Status` = 'active' AND (`T1`.`Category_ID` = '7728' OR (FIND_IN_SET('7728', `T1`.`Crossed`) > 0) OR FIND_IN_SET('7728', `T3`.`Parent_IDs`) > 0 ) AND ((`T1`.`country` = 'countries_mexico' AND `T1`.`country_level1` = 'countries_mexico_jalisco' AND `T1`.`country_level2` = 'countries_mexico_jalisco_quitupan') OR (3956 * 2 * ASIN(SQRT( POWER(SIN((19.85 - `T1`.`Loc_latitude`) * 0.0174532925 / 2), 2) + COS(19.85 * 0.0174532925) * COS(`T1`.`Loc_latitude` * 0.0174532925) * POWER(SIN((-102.8333 - `T1`.`Loc_longitude`) * 0.0174532925 / 2), 2))) <= 124.27423844747)) AND `T1`.`Sub_status` <> 'invisible' ORDER BY `mf_filter_match` DESC, `mf_distance` ASC, `Featured_date` DESC , `T1`.`date` DESC LIMIT 0, 24 Array
(
)