...
|
...
|
@@ -59,14 +59,17 @@ class AdminStatisticsController extends AdminBaseController{ |
|
|
|
|
|
//时间段统计
|
|
|
|
|
|
|
|
|
|
|
|
$sql="SELECT count(*) as num FROM sleep_order where FROM_UNIXTIME(start_time,'%H:%i:%S')>'06:00:00' AND FROM_UNIXTIME(start_time,'%H:%i:%S')<'11:00:00'";
|
|
|
$num=Db::query($sql);
|
|
|
|
|
|
|
|
|
dump($num);
|
|
|
|
|
|
$interval=array();
|
|
|
$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'";
|
|
|
$interval[0]=Db::query($sql);
|
|
|
$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'";
|
|
|
$interval[1]=Db::query($sql);
|
|
|
$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'";
|
|
|
$interval[2]=Db::query($sql);
|
|
|
$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'";
|
|
|
$interval[3]=Db::query($sql);
|
|
|
$this->assign('interval',json_encode($interval));
|
|
|
dump($interval);
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
|
...
|
...
|
|