mysql 获取本周、本月记录
***mysql 获取本周记录,中国的周以周一开始,与美国不同,故需要推迟一天***
SELECT * FROM tes_record WHERE YEARWEEK(date_format(test_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1);
***mysql 获取本月记录***
SELECT * FROM tes_record WHERE DATE_FORMAT( test_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )