作者 董瑞恩
1 个管道 的构建 通过 耗费 0 秒

order

@@ -60,13 +60,13 @@ class AdminStatisticsController extends AdminBaseController{ @@ -60,13 +60,13 @@ class AdminStatisticsController extends AdminBaseController{
60 //时间段统计 60 //时间段统计
61 61
62 $interval=array(); 62 $interval=array();
63 - $sql="SELECT count(*) as num FROM sleep_order where FROM_UNIXTIME(start_time,'%H:%i:%S')>'00:00:00' AND FROM_UNIXTIME(start_time,'%H:%i:%S')<'07:00:00' OR FROM_UNIXTIME(start_time,'%H:%i:%S')>'21:00:00' AND FROM_UNIXTIME(start_time,'%H:%i:%S')<'24:00:00'"; 63 + $sql="SELECT count(*) FROM sleep_order where FROM_UNIXTIME(start_time,'%H:%i:%S')>'00:00:00' AND FROM_UNIXTIME(start_time,'%H:%i:%S')<'07:00:00' OR FROM_UNIXTIME(start_time,'%H:%i:%S')>'21:00:00' AND FROM_UNIXTIME(start_time,'%H:%i:%S')<'24:00:00'";
64 $interval[0]=Db::query($sql); 64 $interval[0]=Db::query($sql);
65 - $sql="SELECT count(*) as num FROM sleep_order where FROM_UNIXTIME(start_time,'%H:%i:%S')>'07:00:00' AND FROM_UNIXTIME(start_time,'%H:%i:%S')<'12:00:00'"; 65 + $sql="SELECT count(*) FROM sleep_order where FROM_UNIXTIME(start_time,'%H:%i:%S')>'07:00:00' AND FROM_UNIXTIME(start_time,'%H:%i:%S')<'12:00:00'";
66 $interval[1]=Db::query($sql); 66 $interval[1]=Db::query($sql);
67 - $sql="SELECT count(*) as num FROM sleep_order where FROM_UNIXTIME(start_time,'%H:%i:%S')>'12:00:00' AND FROM_UNIXTIME(start_time,'%H:%i:%S')<'17:00:00'"; 67 + $sql="SELECT count(*) FROM sleep_order where FROM_UNIXTIME(start_time,'%H:%i:%S')>'12:00:00' AND FROM_UNIXTIME(start_time,'%H:%i:%S')<'17:00:00'";
68 $interval[2]=Db::query($sql); 68 $interval[2]=Db::query($sql);
69 - $sql="SELECT count(*) as num FROM sleep_order where FROM_UNIXTIME(start_time,'%H:%i:%S')>'17:00:00' AND FROM_UNIXTIME(start_time,'%H:%i:%S')<'21:00:00'"; 69 + $sql="SELECT count(*) FROM sleep_order where FROM_UNIXTIME(start_time,'%H:%i:%S')>'17:00:00' AND FROM_UNIXTIME(start_time,'%H:%i:%S')<'21:00:00'";
70 $interval[3]=Db::query($sql); 70 $interval[3]=Db::query($sql);
71 $this->assign('interval',json_encode($interval)); 71 $this->assign('interval',json_encode($interval));
72 dump($interval); 72 dump($interval);