6
0
Fork 0
release
李静 2022-01-14 11:20:33 +08:00
parent 61ce40b3dc
commit c0e5a5817b
1 changed files with 2 additions and 2 deletions

View File

@ -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;