mirror of
https://github.com/v2board/v2board.git
synced 2025-01-26 16:09:09 +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('user_id', $userId)
|
||||||
->where('rate', $rate)
|
->where('rate', $rate)
|
||||||
->where('method', $method)
|
->where('method', $method)
|
||||||
->lockForUpdate()
|
|
||||||
->first();
|
->first();
|
||||||
if ($serverLog) {
|
if ($serverLog) {
|
||||||
$serverLog->u = $serverLog->u + $u;
|
try {
|
||||||
$serverLog->d = $serverLog->d + $d;
|
$serverLog->increment('u', $u);
|
||||||
return $serverLog->save();
|
$serverLog->increment('d', $d);
|
||||||
|
return true;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$serverLog = new ServerLog();
|
$serverLog = new ServerLog();
|
||||||
$serverLog->user_id = $userId;
|
$serverLog->user_id = $userId;
|
||||||
|
Loading…
Reference in New Issue
Block a user