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