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
acc05dff
Commit
acc05dff
authored
Nov 08, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
0693640e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
CoinIssueCoin.php
common/models/psources/CoinIssueCoin.php
+2
-0
IssueChainTransferController.php
console/controllers/IssueChainTransferController.php
+16
-2
No files found.
common/models/psources/CoinIssueCoin.php
View file @
acc05dff
...
@@ -25,6 +25,8 @@ class CoinIssueCoin extends CommonActiveRecord
...
@@ -25,6 +25,8 @@ class CoinIssueCoin extends CommonActiveRecord
const
TYPE_NO
=
0
;
//不是增发
const
TYPE_NO
=
0
;
//不是增发
const
TYPE_YES
=
1
;
//是增发
const
TYPE_YES
=
1
;
//是增发
const
ISSUE_TOKEN
=
'issue_token'
;
//定义场景
//定义场景
const
SCENARIOS_CREATE
=
'create'
;
const
SCENARIOS_CREATE
=
'create'
;
const
SCENARIOS_UPDATE
=
'update'
;
const
SCENARIOS_UPDATE
=
'update'
;
...
...
console/controllers/IssueChainTransferController.php
View file @
acc05dff
...
@@ -127,6 +127,7 @@ class IssueChainTransferController extends Controller
...
@@ -127,6 +127,7 @@ class IssueChainTransferController extends Controller
public
function
actionQueryTransaction
(
$step
)
public
function
actionQueryTransaction
(
$step
)
{
{
$redis
=
Yii
::
$app
->
redis
;
if
(
1
==
$step
)
{
if
(
1
==
$step
)
{
$model
=
CoinIssueChainRecord
::
find
()
->
where
([
'pre_query_transaction'
=>
'standby'
])
->
all
();
$model
=
CoinIssueChainRecord
::
find
()
->
where
([
'pre_query_transaction'
=>
'standby'
])
->
all
();
}
}
...
@@ -142,6 +143,7 @@ class IssueChainTransferController extends Controller
...
@@ -142,6 +143,7 @@ class IssueChainTransferController extends Controller
$node
=
Yii
::
$app
->
params
[
'chain_nodes'
][
'STO'
];
$node
=
Yii
::
$app
->
params
[
'chain_nodes'
][
'STO'
];
$service
=
new
Chain33Service
(
$node
);
$service
=
new
Chain33Service
(
$node
);
$current_time
=
time
();
foreach
(
$model
as
$val
)
{
foreach
(
$model
as
$val
)
{
if
(
1
==
$step
)
{
if
(
1
==
$step
)
{
$result
=
$service
->
QueryTransaction
(
$val
->
pre_send_transaction
);
$result
=
$service
->
QueryTransaction
(
$val
->
pre_send_transaction
);
...
@@ -167,6 +169,7 @@ class IssueChainTransferController extends Controller
...
@@ -167,6 +169,7 @@ class IssueChainTransferController extends Controller
}
else
{
}
else
{
$status
=
CoinIssueCoin
::
STATUS_SUCCESS
;
$status
=
CoinIssueCoin
::
STATUS_SUCCESS
;
}
}
$redis
->
hdel
(
CoinIssueCoin
::
ISSUE_TOKEN
,
$val
->
id
);
goto
doEnd
;
goto
doEnd
;
}
else
if
(
isset
(
$result
[
'result'
][
'receipt'
][
'ty'
])
&&
2
==
$result
[
'result'
][
'receipt'
][
'ty'
])
{
}
else
if
(
isset
(
$result
[
'result'
][
'receipt'
][
'ty'
])
&&
2
==
$result
[
'result'
][
'receipt'
][
'ty'
])
{
$data
=
[
$data
=
[
...
@@ -184,6 +187,7 @@ class IssueChainTransferController extends Controller
...
@@ -184,6 +187,7 @@ class IssueChainTransferController extends Controller
}
else
{
}
else
{
$status
=
CoinIssueCoin
::
STATUS_SUCCESS
;
$status
=
CoinIssueCoin
::
STATUS_SUCCESS
;
}
}
$redis
->
hdel
(
CoinIssueCoin
::
ISSUE_TOKEN
,
$val
->
id
);
goto
doEnd
;
goto
doEnd
;
}
else
{
}
else
{
$status
=
CoinIssueCoin
::
STATUS_FAILED
;
$status
=
CoinIssueCoin
::
STATUS_FAILED
;
...
@@ -206,11 +210,21 @@ class IssueChainTransferController extends Controller
...
@@ -206,11 +210,21 @@ class IssueChainTransferController extends Controller
$data
[
'finish_send_transaction'
]
=
'failed'
;
$data
[
'finish_send_transaction'
]
=
'failed'
;
$data
[
'finish_query_transaction'
]
=
'failed'
;
$data
[
'finish_query_transaction'
]
=
'failed'
;
}
}
$cache_error_time
=
$redis
->
hget
(
CoinIssueCoin
::
ISSUE_TOKEN
,
$val
->
id
);
if
(
false
==
$cache_error_time
)
{
$redis
->
hmset
(
CoinIssueCoin
::
ISSUE_TOKEN
,
$val
->
id
,
$current_time
);
continue
;
}
if
((
$current_time
-
$cache_error_time
)
<
10
)
{
continue
;
}
$redis
->
hdel
(
CoinIssueCoin
::
ISSUE_TOKEN
,
$val
->
id
);
goto
doEnd
;
goto
doEnd
;
}
}
doEnd
:
doEnd
:
#echo json_encode($data).PHP_EOL;
#echo $status.PHP_EOL;exit;
CoinIssueChainRecord
::
updateAll
(
$data
,
[
CoinIssueChainRecord
::
updateAll
(
$data
,
[
'id'
=>
$val
->
id
,
'id'
=>
$val
->
id
,
]);
]);
...
...
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