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

order

@@ -68,12 +68,10 @@ class AdminStatisticsController extends AdminBaseController{ @@ -68,12 +68,10 @@ class AdminStatisticsController extends AdminBaseController{
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(*) 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'";
70 $interval[3]=Db::query($sql); 70 $interval[3]=Db::query($sql);
71 -  
72 foreach ($interval as $k=>$v){ 71 foreach ($interval as $k=>$v){
73 $interval[$k]=$interval[$k][0]['num']; 72 $interval[$k]=$interval[$k][0]['num'];
74 } 73 }
75 $this->assign('interval',json_encode($interval)); 74 $this->assign('interval',json_encode($interval));
76 - dump($interval);  
77 return $this->fetch(); 75 return $this->fetch();
78 } 76 }
79 77
@@ -95,7 +95,7 @@ @@ -95,7 +95,7 @@
95 //时间段统计数据 95 //时间段统计数据
96 var dateX = ['21点-7点','17点-12点','12点-17点','17点-21点']; 96 var dateX = ['21点-7点','17点-12点','12点-17点','17点-21点'];
97 97
98 - var dateY = [1,2,3,4]; 98 + var dateY = {$interval};
99 99
100 var num=0; 100 var num=0;
101 101