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