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

order

... ... @@ -29,7 +29,12 @@ class AdminAllStatisticsController extends AdminBaseController{
public function index(){
$Order=new OrderModel();
$data=$Order->paginate(10);
$data=$Order->alias('a')
->field('a.*,b.serial_number,b.hospital,sum() as sumTime')
->join('equipment b','a.mac_address=b.mac_address')
->group('mac_address')
->order('start_time','desc')
->paginate(10);
$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'])/3600;
$item['time']=($item['end_time']-$item['start_time']);
return $item;
});
$this->assign('data',$data);
... ...