作者 潘浩文
1 个管道 的构建 通过 耗费 1 秒

XIAOPAN

... ... @@ -85,6 +85,7 @@ class AdminStatisticsController extends AdminBaseController{
$Month_statistics=array();
$Month_money=array();
$Month=array();
$Month_note_money=array();
for ($i = 0; $i<24; $i++){
$Month[]=date('Y-m-d',$month_interval[$i][1]);
$Month_statistics[]=Db::name('order')->where('start_time','between',$month_interval[$i])->count();
... ... @@ -107,7 +108,7 @@ class AdminStatisticsController extends AdminBaseController{
$this->assign('month',json_encode($Month));
$this->assign('monthData',json_encode($Month_statistics));
$this->assign('monthMoney',json_encode($Month_money));
$this->assign('Month_note_money',json_encode($Month_note_money));
//时间段统计
$interval=array();
$sql="SELECT sleep_equipment.hospital,count(*) as num FROM sleep_order INNER JOIN sleep_equipment ON sleep_order.eq_name=sleep_equipment.name where (".$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'))";
... ...
... ... @@ -59,6 +59,11 @@
<div id="main12" class="my_main3"></div>
</div>
</div>
<div class="xhzb_wrap" style="height: 250px">
<div>
<div id="main13" class="my_main3"></div>
</div>
</div>
</div>
</div>
... ... @@ -143,7 +148,7 @@
var monthDataX = JSON.parse('{$month}');
var monthDataY = JSON.parse('{$monthData}');
var monthMoney = JSON.parse('{$monthMoney}');
var Month_note_money = JSON.parse('{$Month_note_money}');
// 路径配置
require.config({
... ... @@ -168,7 +173,7 @@
var myChart10 = ec.init(document.getElementById('main10'),'macarons');
var myChart11 = ec.init(document.getElementById('main11'),'macarons');
var myChart12 = ec.init(document.getElementById('main12'),'macarons');
var myChart13 = ec.init(document.getElementById('main13'),'macarons');
//时间段统计(柱形图)
var option = {
backgroundColor:'white',
... ... @@ -546,6 +551,58 @@
}
]
};
var option13 = {
backgroundColor : "white",
color : ["#c05050","#59678c"],
title:{
text : '科室月营业额统计',
y: '15'
},
tooltip : {
trigger: 'axis',
showDelay: 0, // 显示延迟,添加显示延迟可以避免频繁切换,单位ms
formatter: "{b}</br>{a} : {c}元"
},
dataZoom : {
show : true,
realtime: true,
y : 220,
height: 20,
start : 75,
end : 100
},
calculable : true,
grid: {
x: 80,
y: 40,
x2:60,
},
xAxis : [
{
type : 'category',
boundaryGap : true,
data : monthDataX
}
],
yAxis : [
{
type : 'value',
scale:true,
}
],
series : [
{
name:'月统计',
type:'line',
//stack: '人数',
barWidth : 10,
data:Month_note_money
}
]
};
// 为echarts对象加载数据
myChart.setOption(option);
myChart2.setOption(option4);
... ... @@ -553,6 +610,7 @@
myChart10.setOption(option10);
myChart11.setOption(option11);
myChart12.setOption(option12);
myChart13.setOption(option13);
// console.log({c});
}
);
... ...