Ejemplo n.º 1
0
 /**
  * 根据时间进行统计
  */
 public function doReportByTimeAction()
 {
     global $_F;
     $_F["debug"] = true;
     $report_log = new FLogger("report_log");
     // 获取统计的日期
     $time_str = FRequest::getString('time');
     $report_log->append("~~~~~统计开始 by time,时间:" . $time_str);
     echo "~~~~~统计开始 by time,时间:" . $time_str . "<br>";
     $tm = date("Y-m-d 00:00:00", strtotime($time_str));
     echo $tm . "<br>";
     $b = time();
     for ($i = 0; $i < 24; $i++) {
         $stm = date("Y-m-d H:00:00", strtotime($tm) + $i * 3600);
         $etm = date("Y-m-d H:00:00", strtotime($tm) + ($i + 1) * 3600);
         //  echo($stm."----".$etm."<br>");
         Service_Edit::statistics($stm, $etm);
     }
     $e = time();
     $report_log->append("~~~~~统计结束,时间:" . $time_str . "---- cost : " . ($e - $b));
     echo "~~~~~统计结束,时间:" . $time_str . "---- cost : " . ($e - $b);
 }