Commit 7a970ea6 authored by shajiaiming's avatar shajiaiming

fi

parent fb07ed84
......@@ -22,7 +22,7 @@ class CrossChainController extends Controller
return 0;
}
foreach ($model as $val) {
if( $step > 1) {
if ($step > 1) {
$isExist = CoinCrossChain::find()
->where(['transfer_number' => $val['transfer_number']])
->andWhere(['<', 'id', (int)$val['id']])
......@@ -93,7 +93,18 @@ class CrossChainController extends Controller
$service = new Chain33Service($node_params);
$send_result = $val['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']);
if (false == $cache_error_time) {
$redis->hmset(CoinCrossChain::CROSS_CHAIN_CACHE_FAIL, $val['address'] . ':' . $val['is_with_draw'], $current_time);
......@@ -105,23 +116,18 @@ class CrossChainController extends Controller
}
$redis->hdel(CoinCrossChain::CROSS_CHAIN_CACHE_FAIL, $val['address'] . ':' . $val['is_with_draw']);
if (-1 == $result['code']) {
$msg = $result['msg'];
$query_result = $result['code'];
goto doEnd;
}
if (isset($result['result']['actionName']) && 'unknown' == $result['result']['actionName']) {
$query_result = 'success';
$msg = 'success';
} else if (isset($result['result']['receipt']['ty']) && 2 == $result['result']['receipt']['ty']) {
$query_result = 'success';
$msg = 'success';
} else {
$query_result = 'fail';
foreach ($result['result']['receipt']['logs'] as $log) {
if (is_array($log['log'])) continue;
$msg = isset($log['log']) ? $log['log'] : '查询错误';
}
goto doEnd;
}
}
doEnd :
......
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