Commit 7a970ea6 authored by shajiaiming's avatar shajiaiming

fi

parent fb07ed84
...@@ -22,7 +22,7 @@ class CrossChainController extends Controller ...@@ -22,7 +22,7 @@ class CrossChainController extends Controller
return 0; return 0;
} }
foreach ($model as $val) { foreach ($model as $val) {
if( $step > 1) { if ($step > 1) {
$isExist = CoinCrossChain::find() $isExist = CoinCrossChain::find()
->where(['transfer_number' => $val['transfer_number']]) ->where(['transfer_number' => $val['transfer_number']])
->andWhere(['<', 'id', (int)$val['id']]) ->andWhere(['<', 'id', (int)$val['id']])
...@@ -93,7 +93,18 @@ class CrossChainController extends Controller ...@@ -93,7 +93,18 @@ class CrossChainController extends Controller
$service = new Chain33Service($node_params); $service = new Chain33Service($node_params);
$send_result = $val['send_result']; $send_result = $val['send_result'];
$result = $service->QueryTransaction($send_result); $result = $service->QueryTransaction($send_result);
if (-1 == $result['code']) {
if (isset($result['result']['actionName']) && 'unknown' == $result['result']['actionName']) {
$redis->hdel(CoinCrossChain::CROSS_CHAIN_CACHE_FAIL, $val['address'] . ':' . $val['is_with_draw']);
$query_result = 'success';
$msg = 'success';
goto doEnd;
} else if (isset($result['result']['receipt']['ty']) && 2 == $result['result']['receipt']['ty']) {
$redis->hdel(CoinCrossChain::CROSS_CHAIN_CACHE_FAIL, $val['address'] . ':' . $val['is_with_draw']);
$query_result = 'success';
$msg = 'success';
goto doEnd;
} else {
$cache_error_time = $redis->hget(CoinCrossChain::CROSS_CHAIN_CACHE_FAIL, $val['address'] . ':' . $val['is_with_draw']); $cache_error_time = $redis->hget(CoinCrossChain::CROSS_CHAIN_CACHE_FAIL, $val['address'] . ':' . $val['is_with_draw']);
if (false == $cache_error_time) { if (false == $cache_error_time) {
$redis->hmset(CoinCrossChain::CROSS_CHAIN_CACHE_FAIL, $val['address'] . ':' . $val['is_with_draw'], $current_time); $redis->hmset(CoinCrossChain::CROSS_CHAIN_CACHE_FAIL, $val['address'] . ':' . $val['is_with_draw'], $current_time);
...@@ -105,22 +116,17 @@ class CrossChainController extends Controller ...@@ -105,22 +116,17 @@ class CrossChainController extends Controller
} }
$redis->hdel(CoinCrossChain::CROSS_CHAIN_CACHE_FAIL, $val['address'] . ':' . $val['is_with_draw']); $redis->hdel(CoinCrossChain::CROSS_CHAIN_CACHE_FAIL, $val['address'] . ':' . $val['is_with_draw']);
$msg = $result['msg']; if (-1 == $result['code']) {
$query_result = $result['code']; $msg = $result['msg'];
goto doEnd; $query_result = $result['code'];
} goto doEnd;
} else {
if (isset($result['result']['actionName']) && 'unknown' == $result['result']['actionName']) { $query_result = 'fail';
$query_result = 'success'; foreach ($result['result']['receipt']['logs'] as $log) {
$msg = 'success'; if (is_array($log['log'])) continue;
} else if (isset($result['result']['receipt']['ty']) && 2 == $result['result']['receipt']['ty']) { $msg = isset($log['log']) ? $log['log'] : '查询错误';
$query_result = 'success'; }
$msg = 'success'; goto doEnd;
} else {
$query_result = 'fail';
foreach ($result['result']['receipt']['logs'] as $log) {
if (is_array($log['log'])) continue;
$msg = isset($log['log']) ? $log['log'] : '查询错误';
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment