增加 余额检查方法
This commit is contained in:
parent
d9b11fe169
commit
4ca16c809f
@ -128,6 +128,11 @@ private function getBirthdayFromIdCard(): string
|
||||
return $year . '-' . $month . '-' . $day;
|
||||
}
|
||||
|
||||
public function hasBalance(string $amount = "0.01"): bool
|
||||
{
|
||||
return bccomp($this->balance, $amount, 4) >= 0;
|
||||
}
|
||||
|
||||
public function isAdult(): bool
|
||||
{
|
||||
// 如果 birthday_at 为空,那么就返回 false
|
||||
|
Loading…
Reference in New Issue
Block a user