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

order

@@ -28,6 +28,10 @@ use think\Db; @@ -28,6 +28,10 @@ use think\Db;
28 class AdminStatisticsController extends AdminBaseController{ 28 class AdminStatisticsController extends AdminBaseController{
29 29
30 public function index(){ 30 public function index(){
  31 + //医院总体时长统计
  32 + $hospital=Db::name('equipment')->field('hospital')->group('hospital')->select();
  33 + dump($hospital);
  34 +
31 //周统计 35 //周统计
32 $week=array(); 36 $week=array();
33 for ($i = 0; $i <= 15; $i++){ 37 for ($i = 0; $i <= 15; $i++){
@@ -58,7 +62,6 @@ class AdminStatisticsController extends AdminBaseController{ @@ -58,7 +62,6 @@ class AdminStatisticsController extends AdminBaseController{
58 $this->assign('monthData',json_encode($Month_statistics)); 62 $this->assign('monthData',json_encode($Month_statistics));
59 63
60 //时间段统计 64 //时间段统计
61 -  
62 $interval=array(); 65 $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'"; 66 $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'";
64 $interval[0]=Db::query($sql); 67 $interval[0]=Db::query($sql);