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

order

@@ -41,7 +41,8 @@ class AdminStatisticsController extends AdminBaseController{ @@ -41,7 +41,8 @@ class AdminStatisticsController extends AdminBaseController{
41 for ($i = 0; $i<15; $i++){ 41 for ($i = 0; $i<15; $i++){
42 $Week_statistics[]=Db::name('order')->where('start_time','between',$where[$i])->count(); 42 $Week_statistics[]=Db::name('order')->where('start_time','between',$where[$i])->count();
43 } 43 }
44 - dump($Week_statistics); 44 + $this->assign('weekData',json_encode($Week_statistics));
  45 +
45 46
46 $month=array(); 47 $month=array();
47 for ($i = 0; $i <= 24; $i++){ 48 for ($i = 0; $i <= 24; $i++){
@@ -111,11 +111,15 @@ @@ -111,11 +111,15 @@
111 111
112 112
113 113
  114 + //周统计
  115 + var weekDataX = ["第一周","第二周","第三周","第四周","第五周","第六周", "第七周",
  116 + "第八周","第九周","第十周","第十一周","第十二周","第十三周","第十四周","第十五周"];
  117 + var weekDataY = {$weekData};
114 118
115 var axisData = ["第一周","第二周","第三周","第四周","第五周","第六周", "第七周", 119 var axisData = ["第一周","第二周","第三周","第四周","第五周","第六周", "第七周",
116 - "第八周","第九周","第十周","第十一周","第十二周","第十三周","第十四周","第十五周"]; 120 + "第八周","第九周","第十周","第十一周","第十二周","第十三周","第十四周","第十五周"];
  121 + var myData = {$weekData};
117 122
118 - var myData = [1,52,35,46,75,82,15,43,65,35,25,41,83,75,98];  
119 123
120 function GetData(){ 124 function GetData(){
121 var myData = []; 125 var myData = [];
@@ -487,7 +491,7 @@ @@ -487,7 +491,7 @@
487 { 491 {
488 type : 'category', 492 type : 'category',
489 boundaryGap : true, 493 boundaryGap : true,
490 - data : axisData 494 + data : weekDataX
491 } 495 }
492 ], 496 ],
493 yAxis : [ 497 yAxis : [
@@ -503,7 +507,7 @@ @@ -503,7 +507,7 @@
503 type:'line', 507 type:'line',
504 //stack: '人数', 508 //stack: '人数',
505 barWidth : 10, 509 barWidth : 10,
506 - data:myData 510 + data:weekDataY
507 } 511 }
508 ] 512 ]
509 }; 513 };