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

order

@@ -34,8 +34,9 @@ class AdminOrderController extends AdminBaseController{ @@ -34,8 +34,9 @@ class AdminOrderController extends AdminBaseController{
34 $data=$Order->alias('a') 34 $data=$Order->alias('a')
35 ->field('a.*,b.serial_number,b.hospital') 35 ->field('a.*,b.serial_number,b.hospital')
36 ->join('equipment b','a.mac_address=b.mac_address') 36 ->join('equipment b','a.mac_address=b.mac_address')
37 - ->paginate(10);  
38 - dump($data->toArray()); 37 + ->paginate(10)->items(function ($item){
  38 + $item['time']=($item['end_time']-$item['start_time'])/3600;
  39 + });
39 $this->assign('data',$data); 40 $this->assign('data',$data);
40 return $this->fetch(); 41 return $this->fetch();
41 } 42 }