This commit is contained in:
Tokumeikoi
2020-04-26 19:19:31 +08:00
parent 99117cca58
commit ba1c4ffa00
2 changed files with 3 additions and 8 deletions

View File

@ -60,17 +60,12 @@ class ServerController extends Controller
case 2:
$serverLogModel->where('created_at', '>=', strtotime(date('Y-m-1')));
}
$sum = [
'u' => $serverLogModel->sum('u'),
'd' => $serverLogModel->sum('d')
];
$total = $serverLogModel->count();
$res = $serverLogModel->forPage($current, $pageSize)
->get();
return response([
'data' => $res,
'total' => $total,
'sum' => $sum
'total' => $total
]);
}
}