增加 用户组价格计算
This commit is contained in:
parent
1424375a4b
commit
3872b5a9bb
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Events\Users;
|
||||
use App\Exceptions\User\BalanceNotEnoughException;
|
||||
use GeneaLabs\LaravelModelCaching\CachedBuilder;
|
||||
use GeneaLabs\LaravelModelCaching\Traits\Cachable;
|
||||
@ -173,7 +174,6 @@ public function getCostPrice(string $price): string
|
||||
return $this->user_group->getCostPrice($price);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 扣除费用
|
||||
*
|
||||
@ -181,7 +181,6 @@ public function getCostPrice(string $price): string
|
||||
* @param string $description
|
||||
* @param bool $fail
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function reduce(string|null $amount = '0', string $description = '消费', bool $fail = false, array $options = []): string
|
||||
@ -215,6 +214,8 @@ public function reduce(string|null $amount = '0', string $description = '消费'
|
||||
}
|
||||
|
||||
(new Transaction)->create($data);
|
||||
|
||||
broadcast(new Users($this, 'balances.amount.reduced', $this));
|
||||
});
|
||||
|
||||
return $this->balance;
|
||||
@ -227,7 +228,6 @@ public function reduce(string|null $amount = '0', string $description = '消费'
|
||||
* @param string $payment
|
||||
* @param string $description
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function charge(string|null $amount = '0', string $payment = 'console', string $description = '充值', array $options = []): string
|
||||
|
Loading…
Reference in New Issue
Block a user