feat: log operate

This commit is contained in:
JaguarJack
2023-01-02 18:36:22 +08:00
parent d8b4c7d37d
commit 54e595595d
3 changed files with 9 additions and 7 deletions

View File

@@ -33,6 +33,8 @@ class LogLogin extends Model
{
return static::when($email, function ($query) use ($email){
$query->where('account', $email);
})->paginate(request()->get('limit', 10));
})
->orderByDesc('id')
->paginate(request()->get('limit', 10));
}
}

View File

@@ -69,7 +69,7 @@ class LogOperate extends Model
'creator_id' => $user->id,
'http_method' => $request->method(),
'http_code' => $response->getStatusCode(),
'start_at' => $requestStartAt,
'start_at' => intval($requestStartAt/1000),
'time_taken' => $timeTaken,
'ip' => $request->ip(),
'params' => \json_encode($params, JSON_UNESCAPED_UNICODE),