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
eac8344b
Commit
eac8344b
authored
Feb 19, 2020
by
shajiaming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/fast_iterative' into develop
parents
3b1a244d
c4f38ca5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
3 deletions
+24
-3
SupportedChainController.php
api/controllers/SupportedChainController.php
+22
-2
CoinSupportedChain.php
common/models/psources/CoinSupportedChain.php
+2
-1
No files found.
api/controllers/SupportedChainController.php
View file @
eac8344b
...
...
@@ -2,6 +2,7 @@
namespace
api\controllers
;
use
common\business\ExchangeBusiness
;
use
Yii
;
use
api\base\BaseController
;
use
common\models\psources\CoinSupportedChain
;
...
...
@@ -28,10 +29,29 @@ class SupportedChainController extends BaseController
}
$data
=
[];
foreach
(
$supported_chain_model
as
$key
=>
&
$val
)
{
$data
[
$key
][
'
coin_
id'
]
=
isset
(
$val
->
coin
->
id
)
?
$val
->
coin
->
id
:
''
;
$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 @
eac8344b
...
...
@@ -46,6 +46,7 @@ class CoinSupportedChain extends BaseActiveRecord
public
function
getCoin
()
{
return
$this
->
hasOne
(
Coin
::
className
(),
[
'id'
=>
'coin_id'
])
->
select
(
'id, 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