改进 成人判断
This commit is contained in:
parent
729dbdcfa8
commit
c692475809
@ -115,7 +115,8 @@ private function getBirthdayFromIdCard(): string
|
|||||||
|
|
||||||
public function isAdult(): bool
|
public function isAdult(): bool
|
||||||
{
|
{
|
||||||
return $this->birthday_at->diffInYears(now()) >= 18;
|
// 如果 birthday_at 为空,那么就返回 false
|
||||||
|
return $this->birthday_at?->diffInYears(now()) >= 18;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isRealNamed(): bool
|
public function isRealNamed(): bool
|
||||||
|
Loading…
Reference in New Issue
Block a user