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

@ -86,8 +86,8 @@ class DeepbworkController extends Controller
$serverService->log( $serverService->log(
$item['user_id'], $item['user_id'],
$request->input('node_id'), $request->input('node_id'),
$u, $item['u'],
$d, $item['d'],
$server->rate $server->rate
); );
} }

View File

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