mirror of
https://github.com/v2board/v2board.git
synced 2025-01-11 00:29:09 +08:00
fix: server rank
This commit is contained in:
parent
0e6f6358d8
commit
ab9c6c85bb
@ -99,12 +99,13 @@ class StatController extends Controller
|
||||
'server_id',
|
||||
'server_type',
|
||||
'u',
|
||||
'd'
|
||||
'd',
|
||||
DB::raw('(u+d) as total')
|
||||
])
|
||||
->where('record_at', '>=', $timestamp)
|
||||
->where('record_type', 'd')
|
||||
->limit(10)
|
||||
->orderBy('record_at', 'DESC')
|
||||
->orderBy('total', 'DESC')
|
||||
->get()
|
||||
->toArray();
|
||||
foreach ($statistics as $k => $v) {
|
||||
@ -113,7 +114,7 @@ class StatController extends Controller
|
||||
$statistics[$k]['server_name'] = $server['name'];
|
||||
}
|
||||
}
|
||||
$statistics[$k]['total'] = ($v['u'] + $v['d']) / 1073741824;
|
||||
$statistics[$k]['total'] = $statistics[$k]['total'] / 1073741824;
|
||||
}
|
||||
array_multisort(array_column($statistics, 'total'), SORT_DESC, $statistics);
|
||||
return response([
|
||||
|
Loading…
Reference in New Issue
Block a user