diff --git a/app/Models/Host.php b/app/Models/Host.php index a312ca4..7704d73 100644 --- a/app/Models/Host.php +++ b/app/Models/Host.php @@ -236,9 +236,11 @@ public function cost($amount = null, $auto = true): bool } } + $append_description = ''; if ($user_group) { if ($user_group->discount !== 100 && $user_group->discount !== null) { $real_price = $real_price * ($user_group->discount / 100); + $append_description = ' (折扣 ' . $user_group->discount . '%)'; } } @@ -285,6 +287,10 @@ public function cost($amount = null, $auto = true): bool $description = '自动扣费。'; } + if ($append_description) { + $description .= $append_description; + } + $left = $transaction->reduceHostAmount($this->user_id, $this->id, $this->module_id, $real_price, $description); $this->addLog($real_price);