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
9caa5fae
Commit
9caa5fae
authored
Sep 06, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
cf907411
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
9 deletions
+66
-9
CrossChainController.php
api/controllers/CrossChainController.php
+58
-1
CoinCrossChain.php
common/models/psources/CoinCrossChain.php
+2
-2
BetUpdate.sh
shell/BetUpdate.sh
+2
-2
GameStatus.sh
shell/GameStatus.sh
+2
-2
QueryTransaction.sh
shell/QueryTransaction.sh
+2
-2
No files found.
api/controllers/CrossChainController.php
View file @
9caa5fae
...
...
@@ -51,6 +51,7 @@ class CrossChainController extends BaseController
$model
=
new
CoinCrossChain
();
$data
[
'txhex'
]
=
$val
[
'tx'
];
$data
[
'transfer_url'
]
=
$val
[
'url'
];
$data
[
'step'
]
=
$val
[
'step'
];
$model
->
load
(
$data
,
''
);
$model
->
save
();
}
...
...
@@ -61,6 +62,62 @@ class CrossChainController extends BaseController
return
[
'code'
=>
$code
,
'msg'
=>
$msg
];
}
public
function
actionFixTransfer
()
{
$code
=
-
1
;
$request
=
Yii
::
$app
->
request
;
if
(
!
$request
->
isPost
)
{
$msg
=
'请求错误!'
;
goto
doEnd
;
}
$post
=
$request
->
post
();
$data
[
'is_with_draw'
]
=
(
false
==
$post
[
'isWithdraw'
])
?
0
:
1
;
$data
[
'address'
]
=
$post
[
'address'
];
foreach
(
$post
[
'txs'
]
as
$key
=>
$val
)
{
$model
=
CoinCrossChain
::
find
()
->
where
([
'is_with_draw'
=>
$data
[
'is_with_draw'
]])
->
andWhere
([
'address'
=>
$data
[
'address'
]])
->
andWhere
([
'step'
=>
$val
[
'step'
]])
->
andWhere
([
'<>'
,
'msg'
,
'success'
])
->
one
();
if
(
false
==
$model
)
continue
;
$node_params
=
$model
->
transfer_url
;
$node_params
=
explode
(
':'
,
$node_params
);
$node_params
=
[
'scheme'
=>
$node_params
[
0
],
'host'
=>
str_replace
(
'//'
,
''
,
$node_params
[
1
]),
'port'
=>
isset
(
$node_params
[
2
])
?
$node_params
[
2
]
:
''
];
$service
=
new
Chain33Service
(
$node_params
);
$send_result
=
$model
->
send_result
;
$result
=
$service
->
QueryTransaction
(
$send_result
);
if
(
isset
(
$result
[
'result'
][
'actionName'
])
&&
'unknown'
==
$result
[
'result'
][
'actionName'
])
{
$model
->
query_result
=
'success'
;
$model
->
msg
=
'success'
;
$model
->
save
();
continue
;
}
else
if
(
isset
(
$result
[
'result'
][
'receipt'
][
'ty'
])
&&
2
==
$result
[
'result'
][
'receipt'
][
'ty'
])
{
$model
->
query_result
=
'success'
;
$model
->
msg
=
'success'
;
$model
->
save
();
continue
;
}
else
{
$model
->
txhex
=
$val
[
'tx'
];
$model
->
transfer_url
=
$val
[
'url'
];
$model
->
send_result
=
0
;
$model
->
query_result
=
0
;
$model
->
msg
=
0
;
$model
->
save
();
continue
;
}
}
$code
=
0
;
$msg
=
'success'
;
doEnd
:
return
[
'code'
=>
$code
,
'msg'
=>
$msg
];
}
public
function
actionTransferStatus
()
{
$code
=
-
1
;
...
...
@@ -119,7 +176,7 @@ class CrossChainController extends BaseController
}
//交易成功,查询成功
if
(
true
==
$val
[
'send_result'
]
&&
'success'
==
$val
[
'query_result'
]
&&
'success'
==
$val
[
'msg'
])
{
if
(
2
==
$key
){
if
(
2
==
$key
)
{
$step
=
(
2
==
$key
)
?
4
:
(
$key
+
2
);
$code
=
0
;
$msg
=
$val
[
'send_result'
];
...
...
common/models/psources/CoinCrossChain.php
View file @
9caa5fae
...
...
@@ -28,14 +28,14 @@ class CoinCrossChain extends BaseActiveRecord
{
return
[
[[
'is_with_draw'
,
'address'
,
'txhex'
,
'transfer_url'
],
'required'
],
[
'transfer_number'
,
'safe'
]
[
[
'transfer_number'
,
'step'
,
'send_result'
,
'query_result'
,
'msg'
]
,
'safe'
]
];
}
public
function
scenarios
()
{
$scenarios
=
[
self
::
SCENARIOS_CREATE
=>
[
'is_with_draw'
,
'address'
,
'txhex'
,
'transfer_url'
,
'transfer_number'
],
self
::
SCENARIOS_CREATE
=>
[
'is_with_draw'
,
'address'
,
'txhex'
,
'transfer_url'
,
'transfer_number'
,
'step'
,
'send_result'
,
'query_result'
,
'msg'
],
];
return
array_merge
(
parent
::
scenarios
(),
$scenarios
);
}
...
...
shell/BetUpdate.sh
View file @
9caa5fae
#!/bin/bash
while
true
;
do
php /data_wallet/bwallet/dev_token_config/yii game-bet/bet-update
>>
/data_wallet/bwallet/bet-update.log 2>&1
;
sleep
2
;
done
&
\ No newline at end of file
while
true
;
do
php /var/www/html/token_pwallet/yii game-bet/bet-update
>>
/var/log/bet-update.log 2>&1
;
sleep
2
;
done
&
\ No newline at end of file
shell/GameStatus.sh
View file @
9caa5fae
#!/bin/bash
while
true
;
do
php /data_wallet/bwallet/dev_token_config/yii game-bet/game-status
>>
/data_wallet/bwallet/game-status.log 2>&1
;
sleep
5
;
done
&
\ No newline at end of file
while
true
;
do
php /var/www/html/token_pwallet/yii game-bet/game-status
>>
/var/log/game-status.log 2>&1
;
sleep
5
;
done
&
\ No newline at end of file
shell/QueryTransaction.sh
View file @
9caa5fae
#!/bin/bash
while
true
;
do
php /var/www/html/token_pwallet/yii cross-chain/query-transaction
>>
/var/www/html/query-transaction.log 2>&1
;
sleep
20
;
done
&
\ No newline at end of file
while
true
;
do
php /var/www/html/token_pwallet/yii cross-chain/query-transaction
>>
/var/www/html/query-transaction.log 2>&1
;
sleep
5
;
done
&
\ No newline at end of file
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