Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wallet
token
Commits
7a970ea6
Commit
7a970ea6
authored
Sep 09, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fi
parent
fb07ed84
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
CrossChainController.php
console/controllers/CrossChainController.php
+16
-10
No files found.
console/controllers/CrossChainController.php
View file @
7a970ea6
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment