From 7ba00243d1b6a941e44096e805be3742065597a6 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Mon, 13 Feb 2023 18:18:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E6=89=A3=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/Host.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Host.php b/app/Models/Host.php index 830e29d..7bf4fad 100644 --- a/app/Models/Host.php +++ b/app/Models/Host.php @@ -116,7 +116,7 @@ public function isUnavailable(): bool return $this->status === 'unavailable'; } - public function renew($first): bool + public function renew($first = false): bool { if (! $this->isCycle()) { return false; @@ -285,7 +285,7 @@ public function safeDelete(): bool $days = $this->next_due_at->diffInDays(now()); // 算出 1 天的价格 - $price = bcdiv($this->last_paid, $this->next_due_at->daysInMonth, 4); + $price = bcdiv($this->getPrice(), 31, 4); // 算出退还的金额 $amount = bcmul($price, $days, 4);