mysql 获取时间段的值

来源:转载

当天


$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)';

分享给朋友:
您可能感兴趣的文章:
随机阅读: