1、按照三个字段都符合条件来排序

ORDER BY
(
    CASE
    WHEN is_top = 1
    AND top_end_time>UNIX_TIMESTAMP()
    AND top_start_time<UNIX_TIMESTAMP() then
        1
    ELSE
        2
    END
),
sorts DESC,ct desc

相关文章: