update: fix stat

This commit is contained in:
tokumeikoi 2021-09-07 12:49:35 +09:00
parent 14579d1eea
commit a365357770

View File

@ -78,14 +78,16 @@ class V2boardStatistics extends Command
private function statServer()
{
$startAt = strtotime(date('Y-m-d'));
$endAt = strtotime(date('Y-m-d'));
$startAt = strtotime('-1 day', $endAt);
$statistics = ServerLog::select([
'server_id',
'method as server_type',
DB::raw("sum(u) as u"),
DB::raw("sum(d) as d"),
])
->where('log_at', $startAt)
->where('log_at', '>=', $startAt)
->where('log_at', '<', $endAt)
->groupBy('server_id', 'method')
->get()
->toArray();