From c0e5a5817b56d58f047991421dbb73c2310c052f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=9D=99?= Date: Fri, 14 Jan 2022 11:20:33 +0800 Subject: [PATCH] Fix --- app/Models/User.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/User.php b/app/Models/User.php index f9b774d7..40eaa53e 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -392,12 +392,12 @@ class User extends Model implements AuthorizableContract, AuthenticatableContrac */ public static function create(array $attributes = [], ?self $inviter = null): self { - $user = static::query()->create($attributes); - if ($inviter === null) { $inviter = static::find(1); } + $user = static::query()->create($attributes); + // 邀请人的深度 $depth = (int) $inviter?->userInfo?->depth;