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:
socksprox
2025-11-29 14:26:43 +01:00
parent 9ca8da045c
commit a01151130e
2 changed files with 4 additions and 32 deletions
@@ -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();