|
|
@@ -206,6 +206,7 @@ class UsdtWalletService extends BaseService
|
|
|
$to = new \Tron\Address($toAddress['base58'], '', $toAddress['hex']);
|
|
|
$result = $trxWallet->transfer($from, $to, $amount);
|
|
|
$result = (array)$result;
|
|
|
+ RedisService::set("caches:wallet:transfer:result_{$to}", ['to' => $to, 'out' => $otcAddress, 'result' => $result], 7200);
|
|
|
if (isset($result['txID'])) {
|
|
|
return $result;
|
|
|
}
|
|
|
@@ -359,6 +360,7 @@ class UsdtWalletService extends BaseService
|
|
|
}
|
|
|
|
|
|
// 超出分页数,下次处理下一页
|
|
|
+ RedisService::set($cacheKey."trc_result", ['success' => $count, 'fail' => $failedCount, 'retry' => $retryCount], 7200);
|
|
|
if (count($addrList) >= 200) {
|
|
|
RedisService::set("caches:wallet:transferPage", $page + 1, 600);
|
|
|
}
|
|
|
@@ -401,11 +403,12 @@ class UsdtWalletService extends BaseService
|
|
|
|
|
|
$url = sprintf($this->apiUrls['usdt_trx2_transfer_log'], $address, $limit, 'true', 'false');
|
|
|
$headers = ["TRON-PRO-API-KEY" => $this->config['tron_api_key']];
|
|
|
- RedisService::set("caches:wallets:recharge_temp_{$userId}", ['url' => $this->config['tron_api_url'] . $url], 600);
|
|
|
+ RedisService::set("caches:wallets:trx_recharge_temp_{$userId}", ['url' => $this->config['tron_api_url'] . $url], 600);
|
|
|
$result = curl_get($this->config['tron_api_url'] . $url, [], $headers, 10);
|
|
|
$result = $result ? json_decode($result, true) : [];
|
|
|
$datas = isset($result['data']) ? $result['data'] : [];
|
|
|
$status = isset($result['success']) ? $result['success'] : '';
|
|
|
+ RedisService::set("caches:wallets:trx_recharge_result_{$userId}", ['url' => $this->config['tron_api_url'] . $url,'result'=>$result,'result'=>$result], 7200);
|
|
|
if ($status != true || empty($datas)) {
|
|
|
$this->error = '2207';
|
|
|
return false;
|
|
|
@@ -420,7 +423,7 @@ class UsdtWalletService extends BaseService
|
|
|
$amount = moneyFormat($amount / 1000000, 6);
|
|
|
$time = isset($v['block_timestamp']) ? intval($v['block_timestamp'] / 1000) : 0;
|
|
|
$txid = isset($v['transaction_id']) ? $v['transaction_id'] : '';
|
|
|
- if (!CoinLogService::make()->checkExists('txid', $txid) && $time > time() - 12 * 3600) {
|
|
|
+ if (!CoinLogService::make()->checkExists('txid', $txid) && $time > time() - 15 * 24 * 3600) {
|
|
|
$balance = $this->memberModel->where(['id' => $userId])->value('usdt_num');
|
|
|
$orderNo = get_order_num('TR');
|
|
|
$log = [
|
|
|
@@ -469,6 +472,7 @@ class UsdtWalletService extends BaseService
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ RedisService::set("caches:wallets:recharge_trx_result_{$userId}", ['url' => $this->config['tron_api_url'] . $url,'result'=> $result,'logs'=> $logs], 600);
|
|
|
return $logs;
|
|
|
}
|
|
|
|
|
|
@@ -502,7 +506,7 @@ class UsdtWalletService extends BaseService
|
|
|
|
|
|
RedisService::set($cacheKey . '_lock', ['config' => $this->config, 'address' => $address], rand(5, 10));
|
|
|
$headers = ["TRON-PRO-API-KEY" => $this->config['tron_api_key']];
|
|
|
- RedisService::set("caches:wallets:transfer_temp_otc_{$type}", ['url' => $this->config['tron_api_url'] . $url], 600);
|
|
|
+ RedisService::set("caches:wallets:transfer_temp_{$type}", ['url' => $this->config['tron_api_url'] . $url], 600);
|
|
|
$result = curl_get($this->config['tron_api_url'] . $url, [], $headers, 10);
|
|
|
$result = $result ? json_decode($result, true) : [];
|
|
|
$datas = isset($result['data']) ? $result['data'] : [];
|
|
|
@@ -547,6 +551,7 @@ class UsdtWalletService extends BaseService
|
|
|
$result = $result ? json_decode($result, true) : [];
|
|
|
$datas = isset($result['data']) ? $result['data'] : [];
|
|
|
$status = isset($result['success']) ? $result['success'] : '';
|
|
|
+ RedisService::set("caches:wallets:transfer_result_otc", ['url' => $this->config['tron_api_url'] . $url,'result'=>$result], 600);
|
|
|
if ($status != true || empty($datas)) {
|
|
|
$this->error = '2207';
|
|
|
return false;
|
|
|
@@ -563,7 +568,7 @@ class UsdtWalletService extends BaseService
|
|
|
$time = isset($v['block_timestamp']) ? intval($v['block_timestamp'] / 1000) : 0;
|
|
|
$txid = isset($v['transaction_id']) ? $v['transaction_id'] : '';
|
|
|
|
|
|
- if ($time > time() - 12 * 3600) {
|
|
|
+ if ($time > time() - 15 * 24 * 3600) {
|
|
|
|
|
|
// 有记录,且是用户提币
|
|
|
if($tradeType==1){
|
|
|
@@ -596,7 +601,7 @@ class UsdtWalletService extends BaseService
|
|
|
|
|
|
$results['trades'][] = ['log' => $v, 'order' => $coinInfo];
|
|
|
} // 其他交易明细
|
|
|
- else if ($time > time() - 7 * 12 * 3600 && !$coinInfo) {
|
|
|
+ else if ($time > time() - 15 * 24 * 3600 && !$coinInfo) {
|
|
|
$results['logs'][] = [
|
|
|
'type' => 3,
|
|
|
'user_id' => 0,
|
|
|
@@ -666,7 +671,7 @@ class UsdtWalletService extends BaseService
|
|
|
|
|
|
$results['trades'][] = ['log' => $v, 'order' => $orderInfo];
|
|
|
} // 其他交易明细
|
|
|
- else if ($time > time() - 7 * 12 * 3600 && !$coinInfo) {
|
|
|
+ else if ($time > time() - 15 * 24 * 3600 && !$coinInfo) {
|
|
|
$results['logs'][] = [
|
|
|
'type' => 3,
|
|
|
'user_id' => 0,
|
|
|
@@ -740,7 +745,7 @@ class UsdtWalletService extends BaseService
|
|
|
$amount = moneyFormat($amount / 1000000, 6);
|
|
|
$time = isset($v['block_timestamp']) ? intval($v['block_timestamp'] / 1000) : 0;
|
|
|
$txid = isset($v['transaction_id']) ? $v['transaction_id'] : '';
|
|
|
- if (!CoinLogService::make()->checkExists('txid', $txid) && $time > time() - 12 * 3600) {
|
|
|
+ if (!CoinLogService::make()->checkExists('txid', $txid) && $time > time() - 15 * 24 * 3600) {
|
|
|
$balance = $this->memberModel->where(['id' => $userId])->value('usdt_num');
|
|
|
$orderNo = get_order_num('TW');
|
|
|
$log = [
|
|
|
@@ -1032,7 +1037,6 @@ class UsdtWalletService extends BaseService
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* ERC 转账
|
|
|
* @param $to
|
|
|
@@ -1268,7 +1272,7 @@ class UsdtWalletService extends BaseService
|
|
|
$amount = moneyFormat($amount / 1000000, 6);
|
|
|
$time = isset($v['timeStamp']) ? intval($v['timeStamp']) : 0;
|
|
|
$txid = isset($v['hash']) ? $v['hash'] : '';
|
|
|
- if (!CoinLogService::make()->checkExists('txid', $txid) && $time > time() - 12 * 3600) {
|
|
|
+ if (!CoinLogService::make()->checkExists('txid', $txid) && $time > time() - 15 * 24 * 3600) {
|
|
|
$balance = $this->memberModel->where(['id' => $userId])->value('usdt_num');
|
|
|
$orderNo = get_order_num('ER');
|
|
|
$log = [
|
|
|
@@ -1433,7 +1437,7 @@ class UsdtWalletService extends BaseService
|
|
|
$txid = isset($v['hash']) ? $v['hash'] : '';
|
|
|
|
|
|
if($tradeType==1){
|
|
|
- if ($time > time() - 12 * 3600 && $from == $address) {
|
|
|
+ if ($time > time() - 15 * 24 * 3600 && $from == $address) {
|
|
|
|
|
|
// 有记录,且是用户提币
|
|
|
$coinInfo = CoinLogService::make()->getCacheInfoByTxid($txid);
|
|
|
@@ -1466,7 +1470,7 @@ class UsdtWalletService extends BaseService
|
|
|
$results['trades'][] = ['log' => $v, 'order' => $coinInfo];
|
|
|
}
|
|
|
} // 其他交易明细
|
|
|
- else if ($time > time() - 7 * 12 * 3600 && !$coinInfo) {
|
|
|
+ else if ($time > time() - 15 * 24 * 3600 && !$coinInfo) {
|
|
|
$results['logs'][] = [
|
|
|
'type' => 3,
|
|
|
'user_id' => 0,
|
|
|
@@ -1536,7 +1540,7 @@ class UsdtWalletService extends BaseService
|
|
|
|
|
|
$results['trades'][] = ['log' => $v, 'order' => $orderInfo];
|
|
|
} // 其他交易明细
|
|
|
- else if ($time > time() - 7 * 12 * 3600 && !$coinInfo) {
|
|
|
+ else if ($time > time() - 15 * 24 * 3600 && !$coinInfo) {
|
|
|
$results['logs'][] = [
|
|
|
'type' => 3,
|
|
|
'user_id' => 0,
|
|
|
@@ -1629,7 +1633,7 @@ class UsdtWalletService extends BaseService
|
|
|
$amount = moneyFormat($amount / pow(10, $decimal), 6);
|
|
|
$time = isset($v['timestamp']) ? intval($v['timestamp']) : 0;
|
|
|
$txid = isset($v['hash']) ? $v['hash'] : '';
|
|
|
- if (!CoinLogService::make()->checkExists('txid', $txid) && $time > time() - 12 * 3600) {
|
|
|
+ if (!CoinLogService::make()->checkExists('txid', $txid) && $time > time() - 15 * 24 * 3600) {
|
|
|
$balance = $this->memberModel->where(['id' => $userId])->value('usdt_num');
|
|
|
$orderNo = get_order_num('TW');
|
|
|
$log = [
|