Commit fc7cfdda authored by shajiaiming's avatar shajiaiming

交易组查询

parent 51015840
......@@ -146,11 +146,13 @@ class IssueChainTransferController extends Controller
$current_time = time();
foreach ($model as $val) {
if (1 == $step) {
$result = $service->QueryTransaction($val->pre_send_transaction);
$result = $this->queryTransaction($node, $val->pre_send_transaction);
#$result = $service->QueryTransaction($val->pre_send_transaction);
$column = 'pre_query_transaction';
}
if (2 == $step) {
$result = $service->QueryTransaction($val->finish_send_transaction);
$result = $this->queryTransaction($node, $val->finish_send_transaction);
#$result = $service->QueryTransaction($val->finish_send_transaction);
$column = 'finish_query_transaction';
}
if (isset($result['result']['actionName']) && 'unknown' == $result['result']['actionName']) {
......@@ -294,7 +296,8 @@ class IssueChainTransferController extends Controller
$service = new Chain33Service($node);
$current_time = time();
foreach ($issue_coin_model as $val) {
$result = $service->QueryTransaction($val->revoke->revoke_send_transaction);
$result = $this->QueryTransaction($node, $val->revoke->revoke_send_transaction);
#$result = $service->QueryTransaction($val->revoke->revoke_send_transaction);
if (isset($result['result']['actionName']) && 'unknown' == $result['result']['actionName']) {
$data = [
'revoke_query_transaction' => 'success'
......@@ -381,4 +384,22 @@ class IssueChainTransferController extends Controller
$coin_issue_record->save();
}
protected function queryTransaction($node_params, $send_result)
{
static $result = [];
$service = new Chain33Service($node_params);
$result = $service->QueryTransaction($send_result);
if (isset($result['result']['receipt']) && is_array($result['result']['receipt']['logs'])) {
foreach ($result['result']['receipt']['logs'] as $log) {
if (isset($log['tyName']) && 'logerr' == strtolower($log['tyName'])) {
return $result;
}
}
}
if (isset($result['result']['tx']['next'])) {
$this->queryTransaction($node_params, $result['result']['tx']['next']);
}
return $result;
}
}
\ No newline at end of file
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