switch ($type){ case 1: $beginTime=mktime(00,00,00,date('m'),date('d'),date('Y')); $endTime=mktime(23,59,59,date("m"),date("d"),date("Y")); break; case 2: $beginTime=mktime(00,00,00,date('m'),date('d')-1,date('Y')); $endTime = mktime(23,59,59,date('m'),date('d')-1,date('Y')); break; case 3: $beginTime=mktime(00,00,00,date('m'),date('d')-8,date('Y')); $endTime = mktime(23,59,59,date('m'),date('d')-2,date('Y')); break; }