正在显示
2 个修改的文件
包含
7 行增加
和
2 行删除
@@ -29,7 +29,12 @@ class AdminAllStatisticsController extends AdminBaseController{ | @@ -29,7 +29,12 @@ class AdminAllStatisticsController extends AdminBaseController{ | ||
29 | 29 | ||
30 | public function index(){ | 30 | public function index(){ |
31 | $Order=new OrderModel(); | 31 | $Order=new OrderModel(); |
32 | - $data=$Order->paginate(10); | 32 | + $data=$Order->alias('a') |
33 | + ->field('a.*,b.serial_number,b.hospital,sum() as sumTime') | ||
34 | + ->join('equipment b','a.mac_address=b.mac_address') | ||
35 | + ->group('mac_address') | ||
36 | + ->order('start_time','desc') | ||
37 | + ->paginate(10); | ||
33 | $this->assign('data',$data); | 38 | $this->assign('data',$data); |
34 | return $this->fetch(); | 39 | return $this->fetch(); |
35 | } | 40 | } |
@@ -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'])/3600; | 52 | + $item['time']=($item['end_time']-$item['start_time']); |
53 | return $item; | 53 | return $item; |
54 | }); | 54 | }); |
55 | $this->assign('data',$data); | 55 | $this->assign('data',$data); |
-
请 注册 或 登录 后发表评论