feat: #10000 日志用户优化
This commit is contained in:
parent
d1dc9adf0d
commit
53c895ec4b
@ -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;
|
||||||
|
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user