实现功能,活动日期,当天的排在最前,其次是 大于当天的额,最后 是以前的活动
分开,startteim >= 当天的, union starttime< 当天的
问题,分开查,好使,放在一起,大于当天的乱掉
原来是:
(select * from v9_activity where starttime>now() and enable=1 order by starttime ASC)
UNION ALL (select * from v9_activity where starttime < now() and enable=1 order by starttime DESC)
以上排序乱掉
修改为以下:
(SELECT * from (select * from v9_activity where starttime>now() and enable=1 order by starttime ASC) as activity1)
UNION ALL (select * from (select * from v9_activity where starttime < now() and enable=1 order by starttime DESC) as activity2)
分开,startteim >= 当天的, union starttime< 当天的
问题,分开查,好使,放在一起,大于当天的乱掉
原来是:
(select * from v9_activity where starttime>now() and enable=1 order by starttime ASC)
UNION ALL (select * from v9_activity where starttime < now() and enable=1 order by starttime DESC)
以上排序乱掉
修改为以下:
(SELECT * from (select * from v9_activity where starttime>now() and enable=1 order by starttime ASC) as activity1)
UNION ALL (select * from (select * from v9_activity where starttime < now() and enable=1 order by starttime DESC) as activity2)