mysql 获取时间段的值

来源:互联网 时间:2017-07-27

当天


$where['refreshtime']= array('eq',"from_unixtime(refreshtime, '%Y-%m-%d') = curdate()");


一天当 $where['_string'] = 'DATE_SUB(CURDATE(), INTERVAL 1 DAY) <= from_unixtime(refreshtime)';


一周前 $where['_string'] = 'DATE_SUB(CURDATE(), INTERVAL 1 WEEK) <= from_unixtime(refreshtime)';


一个月前 $where['_string'] = 'DATE_SUB(CURDATE(), INTERVAL 1 MONTH) <= from_unixtime(refreshtime)';

相关阅读:
Top