|
|
@@ -340,6 +340,8 @@ class CoinLogService extends BaseService
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ $userInfo = MemberService::make()->getInfo($userId);
|
|
|
+
|
|
|
// 审核失败
|
|
|
$this->model->startTrans();
|
|
|
if($checkStatus == 2){
|
|
|
@@ -351,7 +353,6 @@ class CoinLogService extends BaseService
|
|
|
|
|
|
// 退还
|
|
|
if($total>0){
|
|
|
- $userInfo = MemberService::make()->getInfo($userId);
|
|
|
|
|
|
if(!$this->memberModel->where(['id'=> $userId])->increment('usdt_num', $total)){
|
|
|
$this->model->rollBack();
|
|
|
@@ -385,6 +386,8 @@ class CoinLogService extends BaseService
|
|
|
}
|
|
|
// 审核成功,播币
|
|
|
else if($checkStatus == 4){
|
|
|
+
|
|
|
+
|
|
|
$config = ConfigService::make()->getConfigOptionByGroup(5);
|
|
|
$trcOutAddress = isset($config['trc_out_address'])? $config['trc_out_address'] : '';
|
|
|
$ercOutAddress = isset($config['erc_out_address'])? $config['erc_out_address'] : '';
|
|
|
@@ -403,6 +406,21 @@ class CoinLogService extends BaseService
|
|
|
$this->error = '2019';
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ // 转钱
|
|
|
+ if(!$result = UsdtWalletService::make()->usdtTrcTransfer($userInfo['trc_address'],$num)){
|
|
|
+ $this->model->rollBack();
|
|
|
+ $this->error = '5002';
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!$this->model->where(['id'=> $id])->update(['txid'=> $result['txID'],'status'=> 4,'update_time'=>time()])){
|
|
|
+ $this->model->rollBack();
|
|
|
+ $this->error = '5002';
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
// ERC
|
|
|
@@ -413,19 +431,21 @@ class CoinLogService extends BaseService
|
|
|
}
|
|
|
|
|
|
// 钱包余额
|
|
|
- $balance = UsdtWalletService::make()->getTrc20Usdt($ercOutAddress);
|
|
|
+ $balance = UsdtWalletService::make()->getErc20Usdt($ercOutAddress);
|
|
|
if($balance < $total){
|
|
|
$this->error = '2019';
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ if(!$this->model->where(['id'=> $id])->update(['status'=> 4,'update_time'=>time()])){
|
|
|
+ $this->model->rollBack();
|
|
|
+ $this->error = '5002';
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
- if(!$this->model->where(['id'=> $id])->update(['status'=> 2,'update_time'=>time()])){
|
|
|
- $this->model->rollBack();
|
|
|
- $this->error = '5002';
|
|
|
- return false;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
// 退还
|
|
|
if($total>0){
|