ThinkPHP搜索默认日期区间为当前月

if(!$s_date1=I('get.s_date1')){
    $s_date1=date('Y-m-01',strtotime(date("Y-m-d")));
    $_GET['s_date1']=$s_date1;
}
if(!$s_date2=I('get.s_date2')){
    $s_date2=date('Y-m-d',strtotime("$s_date1 +1 month -1 day"));
    $_GET['s_date2']=$s_date2;
}

猜你喜欢

转载自blog.csdn.net/sr_www/article/details/81040876