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
059683b0
Commit
059683b0
authored
Mar 11, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/issue_coin' into 'master'
Feature/issue coin See merge request
!305
parents
441d81f2
c5f256e6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
SupportedChainController.php
api/controllers/SupportedChainController.php
+22
-1
CoinSupportedChain.php
common/models/psources/CoinSupportedChain.php
+2
-1
No files found.
api/controllers/SupportedChainController.php
View file @
059683b0
...
...
@@ -2,6 +2,7 @@
namespace
api\controllers
;
use
common\business\ExchangeBusiness
;
use
Yii
;
use
api\base\BaseController
;
use
common\models\psources\CoinSupportedChain
;
...
...
@@ -28,9 +29,29 @@ class SupportedChainController extends BaseController
}
$data
=
[];
foreach
(
$supported_chain_model
as
$key
=>
&
$val
)
{
$data
[
$key
][
'chain'
]
=
isset
(
$val
->
coin
->
chain
)
?
$val
->
coin
->
chain
:
''
;
$data
[
$key
][
'id'
]
=
isset
(
$val
->
coin
->
id
)
?
$val
->
coin
->
id
:
''
;
$data
[
$key
][
'name'
]
=
isset
(
$val
->
coin
->
name
)
?
$val
->
coin
->
name
:
''
;
$data
[
$key
][
'icon'
]
=
isset
(
$val
->
coin
->
icon
)
?
$val
->
coin
->
icon
:
''
;
$data
[
$key
][
'name'
]
=
isset
(
$val
->
coin
->
name
)
?
$val
->
coin
->
name
:
''
;
$data
[
$key
][
'sid'
]
=
isset
(
$val
->
coin
->
sid
)
?
$val
->
coin
->
sid
:
''
;
$data
[
$key
][
'nickname'
]
=
isset
(
$val
->
coin
->
nickname
[
$this
->
lang
])
?
$val
->
coin
->
nickname
[
$this
->
lang
]
:
''
;
$data
[
$key
][
'chain'
]
=
isset
(
$val
->
coin
->
chain
)
?
$val
->
coin
->
chain
:
''
;
$data
[
$key
][
'platform'
]
=
isset
(
$val
->
coin
->
platform
)
?
$val
->
coin
->
platform
:
''
;
$data
[
$key
][
'sort'
]
=
isset
(
$val
->
coin
->
sort
)
?
$val
->
coin
->
sort
:
0
;
$data
[
$key
][
'treaty'
]
=
isset
(
$val
->
coin
->
treaty
)
?
$val
->
coin
->
treaty
:
''
;
$data
[
$key
][
'optional_name'
]
=
isset
(
$val
->
coin
->
optional_name
)
?
$val
->
coin
->
optional_name
:
''
;
$data
[
$key
][
'rmb'
]
=
0
;
$data
[
$key
][
'usd'
]
=
0
;
$ticker
=
ExchangeBusiness
::
getquatation
(
$val
->
coin
->
name
);
if
(
false
!=
$ticker
)
{
$data
[
$key
][
'rmb'
]
=
$ticker
[
'rmb'
];
$data
[
$key
][
'usd'
]
=
$ticker
[
'usd'
];
}
}
$msg
=
'success'
;
$code
=
0
;
...
...
common/models/psources/CoinSupportedChain.php
View file @
059683b0
...
...
@@ -46,6 +46,7 @@ class CoinSupportedChain extends BaseActiveRecord
public
function
getCoin
()
{
return
$this
->
hasOne
(
Coin
::
className
(),
[
'id'
=>
'coin_id'
])
->
select
(
'name, chain, icon'
);
return
$this
->
hasOne
(
Coin
::
className
(),
[
'id'
=>
'coin_id'
])
->
select
(
'id, sid, icon, name, introduce, optional_name, nickname, platform, chain, treaty'
);
}
}
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