改进 数据处理
This commit is contained in:
parent
741e47c971
commit
b5a99ffbca
@ -10,7 +10,6 @@
|
|||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
use Illuminate\Support\Facades\Crypt;
|
|
||||||
use Laravel\Sanctum\HasApiTokens;
|
use Laravel\Sanctum\HasApiTokens;
|
||||||
|
|
||||||
class User extends Authenticatable
|
class User extends Authenticatable
|
||||||
@ -72,15 +71,22 @@ protected static function boot()
|
|||||||
|
|
||||||
if ($user->isDirty('id_card')) {
|
if ($user->isDirty('id_card')) {
|
||||||
|
|
||||||
$user->real_name_verified_at = now();
|
if ($user->id_card === null) {
|
||||||
|
$user->real_name_verified_at = null;
|
||||||
|
} else {
|
||||||
|
$user->real_name_verified_at = now();
|
||||||
|
|
||||||
// 更新生日
|
// 更新生日
|
||||||
try {
|
try {
|
||||||
$user->birthday_at = $user->getBirthdayFromIdCard();
|
$user->birthday_at = $user->getBirthdayFromIdCard();
|
||||||
} catch (InvalidFormatException) {
|
} catch (InvalidFormatException) {
|
||||||
$user->birthday_at = null;
|
$user->birthday_at = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
<h3>{{ $user->name }}</h3>
|
<h3>{{ $user->name }}</h3>
|
||||||
|
|
||||||
@if ($user->real_name_verified_at)
|
@if ($user->real_name_verified_at)
|
||||||
<span class="badge bg-success">已完成实人验证</span>
|
<span class="text-success">实人验证于 {{ $user->real_name_verified_at }} </span>
|
||||||
|
<br />
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user