phpcms 中怎么实现最近一个月的数据查询还有某个时间端的数据查询??
展开全部
用户模块 在 phpcms/modules/member/member.php 92行左右!
代码贴下:
//默认选取一个月内的用户,防止用户量过大给数据造成灾难
$where_start_time = strtotime($start_time) ? strtotime($start_time) : 0;
$where_end_time = strtotime($end_time) + 86400;
//开始时间大于结束时间,置换变量
if($where_start_time > $where_end_time) {
$tmp = $where_start_time;
$where_start_time = $where_end_time;
$where_end_time = $tmp;
$tmptime = $start_time;
$start_time = $end_time;
$end_time = $tmptime;
unset($tmp, $tmptime);
}
代码贴下:
//默认选取一个月内的用户,防止用户量过大给数据造成灾难
$where_start_time = strtotime($start_time) ? strtotime($start_time) : 0;
$where_end_time = strtotime($end_time) + 86400;
//开始时间大于结束时间,置换变量
if($where_start_time > $where_end_time) {
$tmp = $where_start_time;
$where_start_time = $where_end_time;
$where_end_time = $tmp;
$tmptime = $start_time;
$start_time = $end_time;
$end_time = $tmptime;
unset($tmp, $tmptime);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询