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

order

@@ -53,7 +53,7 @@ class AdminEquipmentController extends AdminBaseController{ @@ -53,7 +53,7 @@ class AdminEquipmentController extends AdminBaseController{
53 $where['create_time']=['between',[strtotime($param['start_time']),strtotime($param['end_time'])]]; 53 $where['create_time']=['between',[strtotime($param['start_time']),strtotime($param['end_time'])]];
54 } 54 }
55 $Equipment=new EquipmentModel(); 55 $Equipment=new EquipmentModel();
56 - $data=$Equipment->where($where)->paginate(10,false,['query'=>$param]); 56 + $data=$Equipment->where($where)->order('create_time','desc')->paginate(10,false,['query'=>$param]);
57 $this->assign('data',$data); 57 $this->assign('data',$data);
58 $this->assign('name', isset($param['name']) ? $param['name'] : ''); 58 $this->assign('name', isset($param['name']) ? $param['name'] : '');
59 $this->assign('hospital', isset($param['hospital']) ? $param['hospital'] : ''); 59 $this->assign('hospital', isset($param['hospital']) ? $param['hospital'] : '');
@@ -47,6 +47,7 @@ class AdminOrderController extends AdminBaseController{ @@ -47,6 +47,7 @@ class AdminOrderController extends AdminBaseController{
47 ->field('a.*,b.serial_number,b.hospital') 47 ->field('a.*,b.serial_number,b.hospital')
48 ->join('equipment b','a.mac_address=b.mac_address') 48 ->join('equipment b','a.mac_address=b.mac_address')
49 ->where($where) 49 ->where($where)
  50 + ->order('start_time','desc')
50 ->paginate(10)->each(function ($item){ 51 ->paginate(10)->each(function ($item){
51 $item['time']=($item['end_time']-$item['start_time'])/3600; 52 $item['time']=($item['end_time']-$item['start_time'])/3600;
52 return $item; 53 return $item;