浏览代码

Teac赠送

afa 4 月之前
父节点
当前提交
52275f48f2
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      application/api/controller/Ledger.php

+ 2 - 2
application/api/controller/Ledger.php

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