|
@@ -30,9 +30,9 @@ class AdminAllStatisticsController extends AdminBaseController{ |
|
@@ -30,9 +30,9 @@ class AdminAllStatisticsController extends AdminBaseController{ |
30
|
public function index(){
|
30
|
public function index(){
|
31
|
$Order=new OrderModel();
|
31
|
$Order=new OrderModel();
|
32
|
$data=$Order->alias('a')
|
32
|
$data=$Order->alias('a')
|
33
|
- ->field('a.*,b.serial_number,b.hospital,count(a.mac_address) as num,sum(a.time) as sumTime')
|
|
|
34
|
- ->join('equipment b','a.mac_address=b.mac_address')
|
|
|
35
|
- ->group('a.mac_address')
|
33
|
+ ->field('a.*,b.serial_number,b.hospital,count(a.eq_name) as num,sum(a.time) as sumTime')
|
|
|
34
|
+ ->join('equipment b','a.eq_name=b.name')
|
|
|
35
|
+ ->group('a.eq_name')
|
36
|
->order('start_time','desc')
|
36
|
->order('start_time','desc')
|
37
|
->paginate(10)->each(function ($item){
|
37
|
->paginate(10)->each(function ($item){
|
38
|
$item['average']=round($item['sumTime']/$item['num']);
|
38
|
$item['average']=round($item['sumTime']/$item['num']);
|