mirror of
https://github.com/v2board/v2board.git
synced 2025-01-25 15:39:10 +08:00
update: server log
This commit is contained in:
parent
c183462ef3
commit
c2577e37c4
@ -268,12 +268,15 @@ class ServerService
|
||||
->where('user_id', $userId)
|
||||
->where('rate', $rate)
|
||||
->where('method', $method)
|
||||
->lockForUpdate()
|
||||
->first();
|
||||
if ($serverLog) {
|
||||
$serverLog->u = $serverLog->u + $u;
|
||||
$serverLog->d = $serverLog->d + $d;
|
||||
return $serverLog->save();
|
||||
try {
|
||||
$serverLog->increment('u', $u);
|
||||
$serverLog->increment('d', $d);
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$serverLog = new ServerLog();
|
||||
$serverLog->user_id = $userId;
|
||||
|
Loading…
Reference in New Issue
Block a user