mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-23 11:27:30 +08:00
Revert "Combine data with node_id in api output, so its all still "one day", and fits vanilla xboard behaviour"
This reverts commit de39230cbe111bbf793f11bcf5046ef717c67f87. The api change caused issues
This commit is contained in:
@@ -14,20 +14,9 @@ class StatController extends Controller
|
||||
public function getTrafficLog(Request $request)
|
||||
{
|
||||
$startDate = now()->startOfMonth()->timestamp;
|
||||
|
||||
// Aggregate per-node data back to per-day format for backward compatibility
|
||||
$records = StatUser::query()
|
||||
->select([
|
||||
'user_id',
|
||||
'server_rate',
|
||||
'record_at',
|
||||
'record_type',
|
||||
DB::raw('SUM(u) as u'),
|
||||
DB::raw('SUM(d) as d'),
|
||||
])
|
||||
->where('user_id', $request->user()->id)
|
||||
->where('record_at', '>=', $startDate)
|
||||
->groupBy(['user_id', 'server_rate', 'record_at', 'record_type'])
|
||||
->orderBy('record_at', 'DESC')
|
||||
->get();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user