From f544759fbaafdd710a9282ca4599aca53044ba94 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Sun, 15 Jan 2023 07:45:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20Alert=20=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/User.php | 5 +++++ resources/views/real_name/create.blade.php | 14 +++----------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/Models/User.php b/app/Models/User.php index 49e2dee..e5e826a 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -113,6 +113,11 @@ private function getBirthdayFromIdCard(): string return $year . '-' . $month . '-' . $day; } + public function isAdult(): bool + { + return $this->birthday_at->diffInYears(now()) >= 18; + } + public function user_group(): BelongsTo { return $this->belongsTo(UserGroup::class); diff --git a/resources/views/real_name/create.blade.php b/resources/views/real_name/create.blade.php index f6d817c..f09f16a 100644 --- a/resources/views/real_name/create.blade.php +++ b/resources/views/real_name/create.blade.php @@ -5,17 +5,9 @@ @php($user = auth('web')->user()) @if ($user->real_name_verified_at) - + + 您已经完成实人认证。 + @else @if ($user->balance < 1) 您的余额不足 1 元,无法完成实人认证。