From 53c895ec4bb4379a07843c69a87447d900110f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=B8=96=E7=95=8C?= <642747453@qq.com> Date: Mon, 22 Aug 2022 19:03:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20#10000=20=E6=97=A5=E5=BF=97=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/Log.php | 2 +- app/Services/Business/BusinessClient.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Log.php b/app/Models/Log.php index 13b3e46..fd99ae2 100644 --- a/app/Models/Log.php +++ b/app/Models/Log.php @@ -111,7 +111,7 @@ class Log extends Model public function add($targetId = 0, $targetField = '') { - $this->attributes['user_id'] = Auth::id(); + $this->attributes['user_id'] = Auth::id() ?? 1; $this->attributes['target_id'] = $targetId; $this->attributes['target_field'] = $targetField; diff --git a/app/Services/Business/BusinessClient.php b/app/Services/Business/BusinessClient.php index 8952c1f..0648b2c 100644 --- a/app/Services/Business/BusinessClient.php +++ b/app/Services/Business/BusinessClient.php @@ -148,7 +148,7 @@ abstract class BusinessClient $log->target_type = $this->getShop()->plat_id . '--' . $this->getShop()->name; $log->target_id = $this->getShop()->id; $log->target_field = $params['type']; - $log->user_id = Auth::id(); + $log->user_id = Auth::id() ?? 1; if ($size < 64000) { $log->message = json_encode($res, 256); }