添加 Append Description

This commit is contained in:
iVampireSP.com 2022-11-26 22:01:24 +08:00
parent a49ce2c5c0
commit 2b73c92236
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -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);