SELECT SQL_CALC_FOUND_ROWS  wp_rcw2vi_posts.*
					 FROM wp_rcw2vi_posts  INNER JOIN wp_rcw2vi_geodir_gd_place_detail ON (wp_rcw2vi_geodir_gd_place_detail.post_id = wp_rcw2vi_posts.ID)  
					 WHERE 1=1  AND ((wp_rcw2vi_posts.post_type = 'gd_place' AND (wp_rcw2vi_posts.post_status = 'publish' OR wp_rcw2vi_posts.post_status = 'gd-sale-agreed' OR wp_rcw2vi_posts.post_status = 'gd-under-offer')))
					 
					 ORDER BY wp_rcw2vi_geodir_gd_place_detail.distanceto asc, wp_rcw2vi_geodir_gd_place_detail.featured asc
					 LIMIT 0, 6