6
0
Fork 0
release
李静 2022-01-12 15:25:34 +08:00
parent 07e47ae294
commit 48140d5d9e
2 changed files with 4 additions and 4 deletions

View File

@ -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, '-'),
]); ]);
//初始化钱包 //初始化钱包

View File

@ -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(), '-');
} }
/** /**