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
3cecfa21
Commit
3cecfa21
authored
5 years ago
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rollback
parent
95ac3bcb
master
develop
1 merge request
!110
Feature/cross chain
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
24 deletions
+5
-24
GameBetController.php
console/controllers/GameBetController.php
+5
-24
No files found.
console/controllers/GameBetController.php
View file @
3cecfa21
...
...
@@ -83,35 +83,14 @@ class GameBetController extends Controller
echo
date
(
'Y-m-d H:i:s'
)
.
'无节点'
.
PHP_EOL
;
return
0
;
}
foreach
(
$nodes
as
$key
=>
$node
)
{
$service
=
new
Chain33Business
();
$result
=
$service
->
getGameStatus
(
$node
);
if
(
0
!==
$result
[
'code'
])
{
echo
$key
.
':'
.
date
(
'Y-m-d H:i:s'
)
.
$result
[
'msg'
]
.
PHP_EOL
;
continue
;
}
$queryResultItems
=
$result
[
'result'
]
??
[];
if
(
empty
(
$queryResultItems
))
{
echo
$key
.
':'
.
date
(
'Y-m-d H:i:s'
)
.
'error'
.
PHP_EOL
;
continue
;
}
$resultJSON
=
json_decode
(
$queryResultItems
[
'queryResultItems'
][
0
][
'resultJSON'
],
true
);
$current_height
=
$resultJSON
[
'height'
];
$cache_current_height
=
Yii
::
$app
->
redis
->
get
(
'chain33_game_bet_status_height_'
.
$key
);
if
((
$cache_current_height
+
12
)
<
$current_height
)
{
echo
$key
.
':'
.
date
(
'Y-m-d H:i:s'
)
.
'区块高度小于12'
.
PHP_EOL
;
continue
;
}
$height
=
$cache_current_height
-
12
;
$result
=
$service
->
getLastHeader
(
$node
);
$height
=
$result
[
'result'
][
'height'
];
$models
=
CoinGameBet
::
find
()
->
select
(
'round'
)
->
where
([
'and'
,
[
'valid'
=>
CoinGameBet
::
VAILD_FALSE
],
[
'<'
,
'height'
,
$height
],
[
'<'
,
'height'
,
$height
-
12
],
[
'platform'
=>
$key
]
])
->
all
();
if
(
empty
(
$models
)){
...
...
@@ -154,4 +133,5 @@ class GameBetController extends Controller
}
return
0
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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