MySQL数据统计
查询近7天
SELECT * FROM 表名 where DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(时间字段名)
查询上周的数据
SELECT name,submittime FROM enterprise WHERE YEARWEEK(date_format(submittime,'%Y-%m-%d')) = YEARWEEK(now())-1;
查询当天
select *,from_unixtime(ctime) as ct from tbName where ctime>=unix_timestamp(CURDATE())
order by id desc limit 200;