正在显示
2 个修改的文件
包含
6 行增加
和
5 行删除
@@ -41,20 +41,21 @@ class AdminStatisticsController extends AdminBaseController{ | @@ -41,20 +41,21 @@ class AdminStatisticsController extends AdminBaseController{ | ||
41 | $hospital[$k]=$v['hospital']; | 41 | $hospital[$k]=$v['hospital']; |
42 | $num[$k]=$v['num']; | 42 | $num[$k]=$v['num']; |
43 | } | 43 | } |
44 | + | ||
44 | $this->assign('hospital',json_encode($hospital)); | 45 | $this->assign('hospital',json_encode($hospital)); |
45 | $this->assign('num',json_encode($num)); | 46 | $this->assign('num',json_encode($num)); |
46 | 47 | ||
47 | //周统计 | 48 | //周统计 |
48 | $week=array(); | 49 | $week=array(); |
49 | - for ($i = 0; $i <= 30; $i++){ | ||
50 | - $week[30-$i]=strtotime(date('Ymd',strtotime("-$i week"))); | 50 | + for ($i = 0; $i <= 15; $i++){ |
51 | + $week[15-$i]=strtotime(date('Ymd',strtotime("-$i week"))); | ||
51 | } | 52 | } |
52 | $Week=array(); | 53 | $Week=array(); |
53 | - for ($i = 0; $i<30; $i++){ | 54 | + for ($i = 0; $i<15; $i++){ |
54 | $Week[$i]=[$week[$i],$week[$i+1]]; | 55 | $Week[$i]=[$week[$i],$week[$i+1]]; |
55 | } | 56 | } |
56 | $Week_statistics=array(); | 57 | $Week_statistics=array(); |
57 | - for ($i = 0; $i<30; $i++){ | 58 | + for ($i = 0; $i<15; $i++){ |
58 | $Week_statistics[]=Db::name('order')->where('start_time','between',$Week[$i])->count(); | 59 | $Week_statistics[]=Db::name('order')->where('start_time','between',$Week[$i])->count(); |
59 | } | 60 | } |
60 | $this->assign('weekData',json_encode($Week_statistics)); | 61 | $this->assign('weekData',json_encode($Week_statistics)); |
-
请 注册 或 登录 后发表评论