|
|
@@ -214,8 +214,8 @@ class Ledger extends Api
|
|
|
$user = (substr($account, 0, 2) == '0x')? $userModel->getByAddress($account): $userModel->getByUid($account);
|
|
|
if(empty($user)) throw new Exception(__("赠送用户不存在"));
|
|
|
if($user['id'] == $this->auth->id) throw new Exception(__("赠送用户不能是自己"));
|
|
|
- $chabao = $ledgerWalletModel::getWalletChaBao($this->auth->id);
|
|
|
- if(bccomp($amount, $chabao, 2) > 0) throw new Exception(__("余额不足请前往充值"), 15001);
|
|
|
+ $teac = $ledgerWalletModel::getWalletTeac($this->auth->id);
|
|
|
+ if(bccomp($amount, $teac, 2) > 0) throw new Exception(__("余额不足请前往充值"), 15001);
|
|
|
|
|
|
// 更新USDT和账变
|
|
|
$ledgerWalletModel->changeWalletAccount($this->auth->id, Asset::TEAC, -$amount, LedgerTeacChangeModel::GiftPay, $user['id']);
|