|
@@ -50,28 +50,34 @@ class AdminStatisticsController extends AdminBaseController{ |
|
@@ -50,28 +50,34 @@ class AdminStatisticsController extends AdminBaseController{ |
50
|
for ($i = 0; $i <= 30; $i++){
|
50
|
for ($i = 0; $i <= 30; $i++){
|
51
|
$week[30-$i]=strtotime(date('Ymd',strtotime("-$i week")));
|
51
|
$week[30-$i]=strtotime(date('Ymd',strtotime("-$i week")));
|
52
|
}
|
52
|
}
|
53
|
- $Week=array();
|
53
|
+ $Week_interval=array();
|
54
|
for ($i = 0; $i<30; $i++){
|
54
|
for ($i = 0; $i<30; $i++){
|
55
|
- $Week[$i]=[$week[$i],$week[$i+1]];
|
55
|
+ $Week_interval[$i]=[$week[$i],$week[$i+1]];
|
56
|
}
|
56
|
}
|
57
|
$Week_statistics=array();
|
57
|
$Week_statistics=array();
|
|
|
58
|
+ $Week=array();
|
58
|
for ($i = 0; $i<30; $i++){
|
59
|
for ($i = 0; $i<30; $i++){
|
59
|
- $Week_statistics[]=Db::name('order')->where('start_time','between',$Week[$i])->count();
|
60
|
+ $Week[]=date('Y-m-d',$Week_interval[$i][1]);
|
|
|
61
|
+ $Week_statistics[]=Db::name('order')->where('start_time','between',$Week_interval[$i])->count();
|
60
|
}
|
62
|
}
|
|
|
63
|
+ $this->assign('weed',json_encode($Week));
|
61
|
$this->assign('weekData',json_encode($Week_statistics));
|
64
|
$this->assign('weekData',json_encode($Week_statistics));
|
62
|
//月统计
|
65
|
//月统计
|
63
|
$month=array();
|
66
|
$month=array();
|
64
|
for ($i = 0; $i <= 24; $i++){
|
67
|
for ($i = 0; $i <= 24; $i++){
|
65
|
$month[24-$i]=strtotime(date('Y-m-1',strtotime("-$i Month")));
|
68
|
$month[24-$i]=strtotime(date('Y-m-1',strtotime("-$i Month")));
|
66
|
}
|
69
|
}
|
67
|
- $Month=array();
|
70
|
+ $month_interval=array();
|
68
|
for ($i = 0; $i<24; $i++){
|
71
|
for ($i = 0; $i<24; $i++){
|
69
|
- $Month[$i]=[$month[$i],$month[$i+1]];
|
72
|
+ $month_interval[$i]=[$month[$i],$month[$i+1]];
|
70
|
}
|
73
|
}
|
71
|
$Month_statistics=array();
|
74
|
$Month_statistics=array();
|
|
|
75
|
+ $Month=array();
|
72
|
for ($i = 0; $i<24; $i++){
|
76
|
for ($i = 0; $i<24; $i++){
|
73
|
- $Month_statistics[]=Db::name('order')->where('start_time','between',$Month[$i])->count();
|
77
|
+ $Month[]=date('Y-m-d',$month_interval[$i][1]);
|
|
|
78
|
+ $Month_statistics[]=Db::name('order')->where('start_time','between',$month_interval[$i])->count();
|
74
|
}
|
79
|
}
|
|
|
80
|
+ $this->assign('month',json_encode($Month));
|
75
|
$this->assign('monthData',json_encode($Month_statistics));
|
81
|
$this->assign('monthData',json_encode($Month_statistics));
|
76
|
|
82
|
|
77
|
//时间段统计
|
83
|
//时间段统计
|