$today=strtotime(date('Y-m-d',time()));//零点时间戳//今日$res['today']=$this->getData($today,time());//获取昨日起始时间戳和结束时间戳$beginYesterday=mktime(0,0,0,date('m'),date('d')-1,date('Y'));$endYesterday=mktime(0,0,0,date('m'),date('d'),date('Y'))-1;$res['yesterday']=$this->getData($beginYesterday,$endYesterday);//本周$beginThisWeek=mktime(0,0,0,date('m'),date('d')-date('w')+1,date('y'));$endThisWeek=time();$res['this_week']=$this->getData($beginThisWeek,$endThisWeek);//本月$beginThisMonth=mktime(0,0,0,date('m'),1,date('Y'));$endThisMonth=mktime(23,59,59,date('m'),date('t'),date('Y'));$res['this_month']=$this->getData($beginThisMonth,$endThisMonth);//上周$beginLastWeek=strtotime(date("Y-m-d",strtotime('monday last week')));$endLastWeek=strtotime(date("Y-m-d",strtotime('monday this week - 1 days')));$res['last_week']=$this->getData($beginLastWeek,$endLastWeek);//上月$beginLastMonth=strtotime(date('Y-m-01',strtotime('-1 month')));$endLastMonth=strtotime(date('Y-m-t',strtotime('-1 month')));$res['last_month']=$this->getData($beginLastMonth,$endLastMonth);