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
048db0ae
Commit
048db0ae
authored
Nov 12, 2018
by
rlgy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
时时彩获取高度
parent
18ddc65b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
LotteryBusiness.php
common/business/LotteryBusiness.php
+10
-0
LotteryService.php
common/service/chain33/LotteryService.php
+8
-1
LotteryController.php
console/controllers/LotteryController.php
+1
-1
No files found.
common/business/LotteryBusiness.php
View file @
048db0ae
...
...
@@ -105,4 +105,14 @@ class LotteryBusiness
}
return
[
'code'
=>
-
1
,
'msg'
=>
$error
];
}
/**
* 获取最新的区块
*/
public
static
function
getLastHeader
()
{
$service
=
new
LotteryService
();
$result
=
$service
->
getLastHeader
();
return
$result
;
}
}
common/service/chain33/LotteryService.php
View file @
048db0ae
...
...
@@ -172,6 +172,12 @@ class LotteryService
return
$this
->
send
(
$params
,
'Chain33.SendTransaction'
);
}
/**
* 获取最新的区块
*/
public
function
getLastHeader
()
{
return
$this
->
send
([],
'Chain33.GetLastHeader'
);
}
}
\ No newline at end of file
console/controllers/LotteryController.php
View file @
048db0ae
...
...
@@ -40,7 +40,7 @@ class LotteryController extends Controller
}
$lottery_current_result
=
$lottery_current_info
[
'result'
];
//获取最新的区块高度
$last_header
=
Chain33
Business
::
getLastHeader
();
$last_header
=
Lottery
Business
::
getLastHeader
();
if
(
$last_header
[
'code'
]
!=
0
)
{
echo
'获取区块高度失败: '
.
$last_header
[
'msg'
]
.
PHP_EOL
;
sleep
(
2
);
...
...
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