donate until blank valid forever

This commit is contained in:
xiaomlove
2022-04-19 21:03:45 +08:00
parent 41e3ba55ee
commit 63e894abda
6 changed files with 10 additions and 6 deletions

View File

@@ -434,7 +434,11 @@ class User extends Authenticatable
public function isDonating()
{
if ($this->donor == 'yes' && $this->donoruntil && $this->donoruntil->gte(Carbon::now())) {
$rawDonorUntil = $this->getRawOriginal('donoruntil');
if (
$this->donor == 'yes'
&& ($rawDonorUntil === null || $rawDonorUntil == '0000-00-00 00:00:00' || $this->donoruntil->gte(Carbon::now()))
) {
return true;
}
return false;