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

order

@@ -35,10 +35,9 @@ class AdminAllStatisticsController extends AdminBaseController{ @@ -35,10 +35,9 @@ class AdminAllStatisticsController extends AdminBaseController{
35 ->group('a.mac_address') 35 ->group('a.mac_address')
36 ->order('start_time','desc') 36 ->order('start_time','desc')
37 ->paginate(10)->each(function ($item){ 37 ->paginate(10)->each(function ($item){
38 - $item['average']=$item['sumTime']/$item['num']; 38 + $item['average']=round($item['sumTime']/$item['num']);
39 return $item; 39 return $item;
40 }); 40 });
41 - dump($data->toArray());  
42 $this->assign('data',$data); 41 $this->assign('data',$data);
43 return $this->fetch(); 42 return $this->fetch();
44 } 43 }
@@ -49,7 +49,7 @@ class AdminOrderController extends AdminBaseController{ @@ -49,7 +49,7 @@ class AdminOrderController extends AdminBaseController{
49 ->where($where) 49 ->where($where)
50 ->order('start_time','desc') 50 ->order('start_time','desc')
51 ->paginate(10)->each(function ($item){ 51 ->paginate(10)->each(function ($item){
52 - $item['time']=($item['end_time']-$item['start_time']); 52 + $item['time']=ceil(($item['end_time']-$item['start_time'])/3600);
53 return $item; 53 return $item;
54 }); 54 });
55 $this->assign('data',$data); 55 $this->assign('data',$data);