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
a5437286
Commit
a5437286
authored
Jul 17, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
托管钱包余额
parent
36230558
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
WalletController.php
wallet/controllers/WalletController.php
+24
-2
No files found.
wallet/controllers/WalletController.php
View file @
a5437286
...
...
@@ -18,20 +18,42 @@ class WalletController extends BaseController
*/
public
function
actionList
()
{
$platforms
=
CoinPlatform
::
find
()
->
asArray
()
->
all
();
$token_string
=
Yii
::
$app
->
request
->
headers
->
get
(
'Token'
);
$user
=
Admin
::
findIdentityByAccessToken
(
$token_string
);
$platform_id
=
$user
->
platform_id
;
if
(
1
===
$platform_id
)
{
$platforms
=
CoinPlatform
::
find
()
->
select
(
'id, name'
)
->
asArray
()
->
all
();
}
else
{
$platforms
=
CoinPlatform
::
find
()
->
select
(
'id, name'
)
->
where
([
'id'
=>
$platform_id
])
->
asArray
()
->
all
();
}
return
[
'code'
=>
0
,
'msg'
=>
'ok'
,
'data'
=>
$platforms
];
}
public
function
actionWalletBallance
()
{
$token_string
=
Yii
::
$app
->
request
->
headers
->
get
(
'Token'
);
$user
=
Admin
::
findIdentityByAccessToken
(
$token_string
);
$platform_id
=
$user
->
platform_id
;
$node_params
=
[
'scheme'
=>
Yii
::
$app
->
params
[
'trusteeship'
][
'scheme'
],
'host'
=>
Yii
::
$app
->
params
[
'trusteeship'
][
'host'
],
'port'
=>
Yii
::
$app
->
params
[
'trusteeship'
][
'port'
][
$platform_id
]
];
$type
=
Yii
::
$app
->
request
->
get
(
'type'
,
1
);
$page
=
Yii
::
$app
->
request
->
get
(
'page'
,
1
);
$size
=
Yii
::
$app
->
request
->
get
(
'size'
,
15
);
$currency
=
Yii
::
$app
->
request
->
get
(
'currency '
,
''
);
$params
=
[
'type'
=>
$type
,
'page'
=>
$page
,
'size'
=>
$size
,
'currency'
=>
$currency
];
$service
=
new
TrusteeShipService
();
$service
=
new
TrusteeShipService
(
$node_params
);
$result
=
$service
->
getWalletBalance
(
$params
);
return
[
'code'
=>
1
,
'data'
=>
$result
,
'msg'
=>
'success'
];
}
...
...
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