添加 Append Description
This commit is contained in:
parent
a49ce2c5c0
commit
2b73c92236
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user