...
|
...
|
@@ -50,28 +50,34 @@ class AdminStatisticsController extends AdminBaseController{ |
|
|
for ($i = 0; $i <= 30; $i++){
|
|
|
$week[30-$i]=strtotime(date('Ymd',strtotime("-$i week")));
|
|
|
}
|
|
|
$Week=array();
|
|
|
$Week_interval=array();
|
|
|
for ($i = 0; $i<30; $i++){
|
|
|
$Week[$i]=[$week[$i],$week[$i+1]];
|
|
|
$Week_interval[$i]=[$week[$i],$week[$i+1]];
|
|
|
}
|
|
|
$Week_statistics=array();
|
|
|
$Week=array();
|
|
|
for ($i = 0; $i<30; $i++){
|
|
|
$Week_statistics[]=Db::name('order')->where('start_time','between',$Week[$i])->count();
|
|
|
$Week[]=date('Y-m-d',$Week_interval[$i][1]);
|
|
|
$Week_statistics[]=Db::name('order')->where('start_time','between',$Week_interval[$i])->count();
|
|
|
}
|
|
|
$this->assign('weed',json_encode($Week));
|
|
|
$this->assign('weekData',json_encode($Week_statistics));
|
|
|
//月统计
|
|
|
$month=array();
|
|
|
for ($i = 0; $i <= 24; $i++){
|
|
|
$month[24-$i]=strtotime(date('Y-m-1',strtotime("-$i Month")));
|
|
|
}
|
|
|
$Month=array();
|
|
|
$month_interval=array();
|
|
|
for ($i = 0; $i<24; $i++){
|
|
|
$Month[$i]=[$month[$i],$month[$i+1]];
|
|
|
$month_interval[$i]=[$month[$i],$month[$i+1]];
|
|
|
}
|
|
|
$Month_statistics=array();
|
|
|
$Month=array();
|
|
|
for ($i = 0; $i<24; $i++){
|
|
|
$Month_statistics[]=Db::name('order')->where('start_time','between',$Month[$i])->count();
|
|
|
$Month[]=date('Y-m-d',$month_interval[$i][1]);
|
|
|
$Month_statistics[]=Db::name('order')->where('start_time','between',$month_interval[$i])->count();
|
|
|
}
|
|
|
$this->assign('month',json_encode($Month));
|
|
|
$this->assign('monthData',json_encode($Month_statistics));
|
|
|
|
|
|
//时间段统计
|
...
|
...
|
|