改进 续费日期设置
This commit is contained in:
parent
8aaa526699
commit
d72a9f4eb9
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user