Update
parent
07e47ae294
commit
48140d5d9e
|
|
@ -365,7 +365,7 @@ class User extends Model implements AuthorizableContract, AuthenticatableContrac
|
||||||
$user->userInfo()->create([
|
$user->userInfo()->create([
|
||||||
'inviter_id' => $inviter?->id,
|
'inviter_id' => $inviter?->id,
|
||||||
'depth' => $depth + 1,
|
'depth' => $depth + 1,
|
||||||
'path' => Str::finish($inviter?->userInfo?->full_path, '/'),
|
'path' => Str::finish($inviter?->userInfo?->full_path, '-'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//初始化钱包
|
//初始化钱包
|
||||||
|
|
|
||||||
|
|
@ -385,8 +385,8 @@ class UserInfo extends Model
|
||||||
*/
|
*/
|
||||||
public function getParentIdsAttribute(): array
|
public function getParentIdsAttribute(): array
|
||||||
{
|
{
|
||||||
if ($path = trim($this->path, '/')) {
|
if ($path = trim($this->path, '-')) {
|
||||||
return explode('/', $path);
|
return explode('-', $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
|
|
@ -424,7 +424,7 @@ class UserInfo extends Model
|
||||||
*/
|
*/
|
||||||
public function getFullPathAttribute(): string
|
public function getFullPathAttribute(): string
|
||||||
{
|
{
|
||||||
return Str::finish($this->path.$this->getKey(), '/');
|
return Str::finish($this->path.$this->getKey(), '-');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue