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

order

... ... @@ -28,6 +28,10 @@ use think\Db;
class AdminStatisticsController extends AdminBaseController{
public function index(){
$hospital=$this->request->param('hospital');
$where=array();
//医院总体时长统计
$data=Db::name('order')
->alias('a')
... ... @@ -82,7 +86,7 @@ class AdminStatisticsController extends AdminBaseController{
//时间段统计
$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'";
$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);
... ...
... ... @@ -13,18 +13,6 @@
<link href="__TMPL__/public/assets/simpleboot3/css/simplebootadmin.css" rel="stylesheet">
<link href="__STATIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
</head>
<style>
.well{
min-height: 20px;
padding: 19px;
/* margin-bottom: 20px; */
background-color: #ecf0f1;
border: 1px solid transparent;
border-radius: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.05);
box-shadow: inset 0 1px 1px rgba(0,0,0,0.05);
}
</style>
<body>
<div class="data_wrap" style="background: #efeff5; width: 1020px; padding: 10px; overflow: hidden;">
... ... @@ -47,13 +35,12 @@
<div id="main10" class="my_main3"></div>
</div>
</div>
<form class="well form-inline" method="post" action="{:url('AdminEquipment/index')}">
<form class="well form-inline" method="post" action="{:url('AdminStatistics/index')}">
初始医院:
<select class="form-control" id="hospital" name="hospital" style="width: 140px;">
<option value='0'>全部</option>
<option value=''>全部</option>
</select> &nbsp;&nbsp;
<input type="submit" class="btn btn-primary" value="搜索"/>
<a class="btn btn-danger" href="{:url('AdminEquipment/index')}">清空</a>
</form>
<div class="qk_wrap" style=" margin-bottom: 10px;">
<div>
... ...