From c25803aa74135ec152785315ebc008b5b9cb467a Mon Sep 17 00:00:00 2001 From: xboard Date: Wed, 6 Dec 2023 19:11:29 +0800 Subject: [PATCH] =?UTF-8?q?Log:=20=E7=BB=99=E6=B5=81=E9=87=8F=E6=B6=88?= =?UTF-8?q?=E8=B4=B9=E9=98=9F=E5=88=97=E5=BD=93=E4=B8=AD=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9A=84=E7=94=A8=E6=88=B7=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Jobs/TrafficFetchJob.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Jobs/TrafficFetchJob.php b/app/Jobs/TrafficFetchJob.php index a545713..a7fe2ea 100644 --- a/app/Jobs/TrafficFetchJob.php +++ b/app/Jobs/TrafficFetchJob.php @@ -66,13 +66,16 @@ class TrafficFetchJob implements ShouldQueue $newTime = time(); $newU = $user->u + ($v[0] * $targetServer['rate']); $newD = $user->d + ($v[1] * $targetServer['rate']); - \DB::table('v2_user') + $rows = \DB::table('v2_user') ->where('id', $uid) ->update([ 't' => $newTime, 'u' => $newU, 'd' => $newD, ]); + if($rows === 0){ + \Log::error("流量更新失败\n未记录用户ID:{$uid}\n未记录上行:{$user->u}\n未记录下行:{$user->d}"); + } }, 3); } }