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
0172be5d
Commit
0172be5d
authored
Jul 19, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
托管接口调整
parent
79e4e7de
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
37 deletions
+19
-37
AppController.php
api/controllers/AppController.php
+9
-7
TrusteeShipService.php
common/service/trusteeship/TrusteeShipService.php
+5
-12
UserController.php
wallet/controllers/UserController.php
+2
-6
WalletController.php
wallet/controllers/WalletController.php
+3
-12
No files found.
api/controllers/AppController.php
View file @
0172be5d
...
...
@@ -60,15 +60,17 @@ class AppController extends BaseController
$platform_id
=
\Yii
::
$app
->
request
->
post
(
'platform_id'
,
1
);
$data
=
CoinAppVersion
::
getLastStable
(
$type
,
$platform_id
);
if
(
$data
)
{
$logItems
=
json_decode
(
$data
[
'log'
]);
$logstr
=
''
;
foreach
(
$logItems
as
$item
){
if
(
$logstr
){
$logstr
.=
"
\n
"
.
$item
;
}
else
{
$logstr
=
$item
;
if
(
!
empty
(
$data
[
'log'
])){
$logItems
=
json_decode
(
$data
[
'log'
]);
$logstr
=
''
;
foreach
(
$logItems
as
$item
){
if
(
$logstr
){
$logstr
.=
"
\n
"
.
$item
;
}
else
{
$logstr
=
$item
;
}
}
}
$data
[
'log'
]
=
$logstr
;
$data
[
'id'
]
=
(
integer
)
$data
[
'id'
];
...
...
common/service/trusteeship/TrusteeShipService.php
View file @
0172be5d
...
...
@@ -11,8 +11,9 @@ class TrusteeShipService
public
function
__construct
(
$parameter
=
[])
{
$platform_id
=
Yii
::
$app
->
request
->
getPlatformId
();
if
(
empty
(
$parameter
))
{
$this
->
node_params
=
Yii
::
$app
->
params
[
'trusteeship'
];
$this
->
node_params
=
Yii
::
$app
->
params
[
'trusteeship'
]
[
'node_'
.
$platform_id
]
;
}
else
{
$this
->
node_params
=
$parameter
;
}
...
...
@@ -20,22 +21,14 @@ class TrusteeShipService
public
function
urlBuild
(
$uri
=
''
)
{
$config
=
$this
->
node_params
;
$scheme
=
$config
[
'scheme'
]
??
'http'
;
$host
=
$config
[
'host'
]
??
'127.0.0.1'
;
$port
=
(
string
)
$config
[
'port'
]
??
''
;
if
(
$port
)
{
return
$scheme
.
'://'
.
$host
.
':'
.
$port
.
'/'
.
$uri
;
}
else
{
return
$scheme
.
'://'
.
$host
.
'/'
.
$uri
;
}
return
$this
->
node_params
.
'/'
.
$uri
;
}
public
function
send
(
$method
=
'GET'
,
$uri
,
$params
=
[])
{
$ch
=
new
Curl
();
if
(
!
empty
(
$params
))
{
if
(
!
empty
(
$params
))
{
$ch
->
setGetParams
(
$params
);
}
$result
=
$ch
->
$method
(
$this
->
urlBuild
(
$uri
),
false
);
...
...
@@ -43,7 +36,7 @@ class TrusteeShipService
return
[
'code'
=>
-
1
,
'msg'
=>
$ch
->
errorText
];
}
if
(
200
==
$result
[
'code'
]
&&
isset
(
$result
[
'data'
]))
{
return
[
'code'
=>
$result
[
'code'
],
'msg'
=>
$result
[
'data'
]];
return
[
'code'
=>
$result
[
'code'
],
'msg'
=>
$result
[
'data'
]];
}
else
{
return
[
'code'
=>
-
1
,
'msg'
=>
$result
[
'message'
]];
}
...
...
wallet/controllers/UserController.php
View file @
0172be5d
...
...
@@ -132,15 +132,11 @@ class UserController extends BaseController
}
else
{
$platform_id
=
Yii
::
$app
->
request
->
getPlatformId
();
}
if
(
!
isset
(
Yii
::
$app
->
params
[
'trusteeship'
][
'
port'
][
$platform_id
])){
if
(
!
isset
(
Yii
::
$app
->
params
[
'trusteeship'
][
'
node_'
.
$platform_id
])){
return
[
'code'
=>
-
1
,
'data'
=>
[],
'msg'
=>
'此钱包节点尚未开通'
];
}
$node_params
=
[
'scheme'
=>
Yii
::
$app
->
params
[
'trusteeship'
][
'scheme'
],
'host'
=>
Yii
::
$app
->
params
[
'trusteeship'
][
'host'
],
'port'
=>
Yii
::
$app
->
params
[
'trusteeship'
][
'port'
][
$platform_id
]
];
$node_params
=
Yii
::
$app
->
params
[
'trusteeship'
][
'node_'
.
$platform_id
];
$page
=
Yii
::
$app
->
request
->
get
(
'page'
,
1
);
$size
=
Yii
::
$app
->
request
->
get
(
'size'
,
15
);
...
...
wallet/controllers/WalletController.php
View file @
0172be5d
...
...
@@ -38,14 +38,10 @@ class WalletController extends BaseController
}
else
{
$platform_id
=
Yii
::
$app
->
request
->
getPlatformId
();
}
if
(
!
isset
(
Yii
::
$app
->
params
[
'trusteeship'
][
'
port'
][
$platform_id
])){
if
(
!
isset
(
Yii
::
$app
->
params
[
'trusteeship'
][
'
node_'
.
$platform_id
])){
return
[
'code'
=>
-
1
,
'data'
=>
[],
'msg'
=>
'此钱包节点尚未开通'
];
}
$node_params
=
[
'scheme'
=>
Yii
::
$app
->
params
[
'trusteeship'
][
'scheme'
],
'host'
=>
Yii
::
$app
->
params
[
'trusteeship'
][
'host'
],
'port'
=>
Yii
::
$app
->
params
[
'trusteeship'
][
'port'
][
$platform_id
]
];
$node_params
=
Yii
::
$app
->
params
[
'trusteeship'
][
'node_'
.
$platform_id
];
$type
=
Yii
::
$app
->
request
->
get
(
'type'
,
1
);
$page
=
Yii
::
$app
->
request
->
get
(
'page'
,
1
);
...
...
@@ -68,12 +64,7 @@ class WalletController extends BaseController
public
function
actionUserAsset
()
{
$platform_id
=
Yii
::
$app
->
request
->
getPlatformId
();
$node_params
=
[
'scheme'
=>
Yii
::
$app
->
params
[
'trusteeship'
][
'scheme'
],
'host'
=>
Yii
::
$app
->
params
[
'trusteeship'
][
'host'
],
'port'
=>
Yii
::
$app
->
params
[
'trusteeship'
][
'port'
][
$platform_id
]
];
$node_params
=
Yii
::
$app
->
params
[
'trusteeship'
][
'node_'
.
$platform_id
];
$uid
=
Yii
::
$app
->
request
->
get
(
'uid'
,
''
);
$params
=
[
'uid'
=>
$uid
...
...
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