Merge pull request !52 from develop
This commit is contained in:
赵世界 2022-08-22 11:04:03 +00:00 committed by Gitee
commit cf3f571c03
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 2 additions and 2 deletions

View File

@ -111,7 +111,7 @@ class Log extends Model
public function add($targetId = 0, $targetField = '') 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_id'] = $targetId;
$this->attributes['target_field'] = $targetField; $this->attributes['target_field'] = $targetField;

View File

@ -148,7 +148,7 @@ abstract class BusinessClient
$log->target_type = $this->getShop()->plat_id . '--' . $this->getShop()->name; $log->target_type = $this->getShop()->plat_id . '--' . $this->getShop()->name;
$log->target_id = $this->getShop()->id; $log->target_id = $this->getShop()->id;
$log->target_field = $params['type']; $log->target_field = $params['type'];
$log->user_id = Auth::id(); $log->user_id = Auth::id() ?? 1;
if ($size < 64000) { if ($size < 64000) {
$log->message = json_encode($res, 256); $log->message = json_encode($res, 256);
} }