提交 8d7dea6d authored 作者: chengye's avatar chengye

测试统计数据

上级 5233abde
...@@ -26,10 +26,15 @@ class Count extends Base ...@@ -26,10 +26,15 @@ class Count extends Base
foreach ($ares as $a => $b){ foreach ($ares as $a => $b){
$sql = "SELECT count(aa.business_id) as numbs from jz_message aa where aa.jz_qy = '".$b['id']."'"; $sql = "SELECT count(aa.business_id) as numbs from jz_message aa where aa.jz_qy = '".$b['id']."'";
$res = Db::query($sql); $res = Db::query($sql);
$values[$a]['numbs'] = $res[0]['numbs']; array_push($values,$res[0]['numbs']);
} }
return json_encode([$ares,$values]); $tArea = [];
foreach ($ares as $k=>$v){
array_push($tArea,$v['qy']);
}
return json_encode([$tArea,$values]);
} }
} }
\ No newline at end of file
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
var myChart = echarts.init(document.getElementById('main')); var myChart = echarts.init(document.getElementById('main'));
$.get('/jz_area', function (res) { $.get('/jz_area', function (res) {
console.log(res) console.log(res)
var area = res[0];
var vals = res[1];
myChart.setOption({ myChart.setOption({
title: { title: {
text: '各区域基站数据统计' text: '各区域基站数据统计'
...@@ -41,7 +44,7 @@ ...@@ -41,7 +44,7 @@
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], data: area,
axisTick: { axisTick: {
alignWithLabel: true alignWithLabel: true
} }
...@@ -57,7 +60,7 @@ ...@@ -57,7 +60,7 @@
name: '直接访问', name: '直接访问',
type: 'bar', type: 'bar',
barWidth: '60%', barWidth: '60%',
data: [10, 52, 200, 334, 390, 930, 220] data: vals
} }
] ]
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论