自己答了
select count(id) as cc from posts where timer>(UNIX_TIMESTAMP(CURRENT_DATE())) and timer<(UNIX_TIMESTAMP(CURRENT_DATE())+86400)select count(id) as cc from posts where timer>UNIX_TIMESTAMP(date_sub(curdate(),interval 1 day)) and timer<(UNIX_TIMESTAMP(date_sub(curdate(),interval 1 day))+86400)来接分吧