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

order

... ... @@ -35,10 +35,9 @@ class AdminAllStatisticsController extends AdminBaseController{
->group('a.mac_address')
->order('start_time','desc')
->paginate(10)->each(function ($item){
$item['average']=$item['sumTime']/$item['num'];
$item['average']=round($item['sumTime']/$item['num']);
return $item;
});
dump($data->toArray());
$this->assign('data',$data);
return $this->fetch();
}
... ...
... ... @@ -49,7 +49,7 @@ class AdminOrderController extends AdminBaseController{
->where($where)
->order('start_time','desc')
->paginate(10)->each(function ($item){
$item['time']=($item['end_time']-$item['start_time']);
$item['time']=ceil(($item['end_time']-$item['start_time'])/3600);
return $item;
});
$this->assign('data',$data);
... ...