| |
|
select distinct hfslistings.*, (hfslistings.expiry_date < date_add(CURDATE(), INTERVAL 7 DAY)) as is_expired, (hfslistings.expiry_date < date_add(CURDATE(), INTERVAL 7 DAY) OR hfslistings.is_featured = 0) as not_current_feature from hfslistings where 1=1 and mainlistings_completed='1' and description_completed='1' and disciplines_completed='1' order by is_expired, not_current_feature, date_modified desc, horse_name asc
|