改进 数据处理

This commit is contained in:
iVampireSP.com 2023-01-15 07:22:34 +08:00
parent 741e47c971
commit b5a99ffbca
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
2 changed files with 15 additions and 8 deletions

View File

@ -10,7 +10,6 @@
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Crypt;
use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable
@ -72,6 +71,9 @@ protected static function boot()
if ($user->isDirty('id_card')) {
if ($user->id_card === null) {
$user->real_name_verified_at = null;
} else {
$user->real_name_verified_at = now();
// 更新生日
@ -81,6 +83,10 @@ protected static function boot()
$user->birthday_at = null;
}
}
}
});
}

View File

@ -6,7 +6,8 @@
<h3>{{ $user->name }}</h3>
@if ($user->real_name_verified_at)
<span class="badge bg-success">已完成实人验证</span>
<span class="text-success">实人验证于 {{ $user->real_name_verified_at }} </span>
<br />
@endif