From 48140d5d9e2ca77ddf31d648b7605efe8b7d9a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=9D=99?= Date: Wed, 12 Jan 2022 15:25:34 +0800 Subject: [PATCH] Update --- app/Models/User.php | 2 +- app/Models/UserInfo.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Models/User.php b/app/Models/User.php index aa287fc7..10f1830b 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -365,7 +365,7 @@ class User extends Model implements AuthorizableContract, AuthenticatableContrac $user->userInfo()->create([ 'inviter_id' => $inviter?->id, 'depth' => $depth + 1, - 'path' => Str::finish($inviter?->userInfo?->full_path, '/'), + 'path' => Str::finish($inviter?->userInfo?->full_path, '-'), ]); //初始化钱包 diff --git a/app/Models/UserInfo.php b/app/Models/UserInfo.php index 2eaeeb43..7b4ab73f 100644 --- a/app/Models/UserInfo.php +++ b/app/Models/UserInfo.php @@ -385,8 +385,8 @@ class UserInfo extends Model */ public function getParentIdsAttribute(): array { - if ($path = trim($this->path, '/')) { - return explode('/', $path); + if ($path = trim($this->path, '-')) { + return explode('-', $path); } return []; @@ -424,7 +424,7 @@ class UserInfo extends Model */ public function getFullPathAttribute(): string { - return Str::finish($this->path.$this->getKey(), '/'); + return Str::finish($this->path.$this->getKey(), '-'); } /**