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
43b0e64b
Commit
43b0e64b
authored
May 24, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整dapp交易TSC信息接口
parent
d1317895
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
2 deletions
+32
-2
VisitStatisticsController.php
api/controllers/VisitStatisticsController.php
+2
-2
Chain33Business.php
common/business/Chain33Business.php
+22
-0
Chain33Service.php
common/service/chain33/Chain33Service.php
+8
-0
No files found.
api/controllers/VisitStatisticsController.php
View file @
43b0e64b
...
@@ -9,10 +9,10 @@
...
@@ -9,10 +9,10 @@
namespace
api\controllers
;
namespace
api\controllers
;
use
api\base\BaseController
;
use
api\base\BaseController
;
use
common\business\Chain33Business
;
use
common\models\psources\CoinDailyStatistics
;
use
common\models\psources\CoinDailyStatistics
;
use
common\models\psources\CoinDailyNumbers
;
use
common\models\psources\CoinDailyNumbers
;
use
common\models\psources\CoinDailyTimes
;
use
common\models\psources\CoinDailyTimes
;
use
common\service\chain33\Chain33Service
;
use
Yii
;
use
Yii
;
class
VisitStatisticsController
extends
BaseController
class
VisitStatisticsController
extends
BaseController
...
@@ -120,7 +120,7 @@ class VisitStatisticsController extends BaseController
...
@@ -120,7 +120,7 @@ class VisitStatisticsController extends BaseController
return
[
'code'
=>
-
1
,
'data'
=>
[],
'msg'
=>
'缺少必要的参数'
];
return
[
'code'
=>
-
1
,
'data'
=>
[],
'msg'
=>
'缺少必要的参数'
];
}
}
$service
=
new
Chain33
Service
();
$service
=
new
Chain33
Business
();
$result
=
$service
->
getDappTradeResult
(
$coins_address
);
$result
=
$service
->
getDappTradeResult
(
$coins_address
);
if
(
0
!==
$result
[
'code'
]){
if
(
0
!==
$result
[
'code'
]){
...
...
common/business/Chain33Business.php
View file @
43b0e64b
...
@@ -141,8 +141,27 @@ class Chain33Business
...
@@ -141,8 +141,27 @@ class Chain33Business
return
$service
->
getBlockHashByHeight
(
$height
);
return
$service
->
getBlockHashByHeight
(
$height
);
}
}
/**
* 获取coin地址下DAPP交易信息
* @param string $address
* @return array
*/
public
static
function
getDappTradeResult
(
$address
)
{
$service
=
new
Chain33Service
();
$execer
=
'wasm'
;
$funcName
=
'WasmGetContractTable'
;
$contractName
=
'user.p.tschain.user.wasm.dice'
;
$items
[]
=
[
'tableName'
=>
'addrinfo'
,
'key'
=>
'addrinfo-'
.
$address
];
return
$service
->
chain33Query
(
$execer
,
$funcName
,
$contractName
,
$items
);
}
/*
/*
* 获取游戏状态
* 获取游戏状态
* @return array
*/
*/
public
static
function
getGameStatus
()
public
static
function
getGameStatus
()
{
{
...
@@ -160,6 +179,9 @@ class Chain33Business
...
@@ -160,6 +179,9 @@ class Chain33Business
/*
/*
* 获取投注状态
* 获取投注状态
* @param integer $start
* @param integer $end
* @return array
*/
*/
public
static
function
getBetStatus
(
$start
,
$end
)
public
static
function
getBetStatus
(
$start
,
$end
)
{
{
...
...
common/service/chain33/Chain33Service.php
View file @
43b0e64b
...
@@ -97,6 +97,14 @@ class Chain33Service
...
@@ -97,6 +97,14 @@ class Chain33Service
return
$this
->
send
(
$params
);
return
$this
->
send
(
$params
);
}
}
/**
* Chain33服务查询
* @param string $execer
* @param string $funcName
* @param string $contractName
* @param array $items
* @return array
*/
public
function
chain33Query
(
$execer
=
'wasm'
,
$funcName
=
'WasmGetContractTable'
,
$contractName
=
'user.p.para.user.wasm.dice'
,
$items
=
[])
public
function
chain33Query
(
$execer
=
'wasm'
,
$funcName
=
'WasmGetContractTable'
,
$contractName
=
'user.p.para.user.wasm.dice'
,
$items
=
[])
{
{
$params
=
[
$params
=
[
...
...
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