改进 续费日期设置

This commit is contained in:
iVampireSP.com 2023-02-13 17:05:41 +08:00
parent 8aaa526699
commit d72a9f4eb9
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -21,10 +21,6 @@ public function creating(Host $host): void
if ($host->managed_price !== null) { if ($host->managed_price !== null) {
$host->managed_price = bcdiv($host->managed_price, 1, 2); $host->managed_price = bcdiv($host->managed_price, 1, 2);
} }
if ($host->billing_cycle !== null) {
$host->next_due_at = $host->getNewDueDate();
}
} }
/** /**
@ -41,6 +37,12 @@ public function created(Host $host): void
$host->price = bcmul($host->price, 1, 2); $host->price = bcmul($host->price, 1, 2);
$host->user->notify(new WebNotification($host, 'hosts.created')); $host->user->notify(new WebNotification($host, 'hosts.created'));
if ($host->isCycle()) {
$host->renew();
}
$host->save();
} }
/** /**