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
c0727eec
Commit
c0727eec
authored
May 19, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/optimize' into 'master'
Feature/optimize See merge request
!335
parents
a7e1763b
39b86587
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
WalletCoinController.php
api/controllers/WalletCoinController.php
+9
-9
No files found.
api/controllers/WalletCoinController.php
View file @
c0727eec
...
...
@@ -86,7 +86,7 @@ class WalletCoinController extends BaseController
$ticker
=
[
'low'
=>
0
,
'high'
=>
0
,
'last'
=>
0
,
'open'
=>
0
,
'vol'
=>
0
,
'rmb'
=>
0
,
'usd'
=>
0
];
foreach
(
$this
->
data
as
$key
=>
&
$val
)
{
$val
[
'chain_quotation'
]
=
isset
(
$coin_quotations
[
strtoupper
(
$val
[
'chain'
])])
?
$coin_quotations
[
strtoupper
(
$val
[
'chain'
])]
:
[];
//
$val['chain_quotation'] = isset($coin_quotations[strtoupper($val['chain'])]) ? $coin_quotations[strtoupper($val['chain'])] : [];
$nickname
=
json_decode
(
$val
[
'nickname'
],
true
);
$val
[
'nickname'
]
=
isset
(
$nickname
[
$this
->
lang
])
?
$nickname
[
$this
->
lang
]
:
''
;
$introduce
=
json_decode
(
$val
[
'introduce'
],
true
);
...
...
@@ -141,14 +141,14 @@ class WalletCoinController extends BaseController
$this
->
data
=
$query
->
offset
((
$page
-
1
)
*
$limit
)
->
limit
(
$limit
)
->
asArray
()
->
all
();
if
(
false
!=
$this
->
data
)
{
$chains
=
array_unique
(
array_column
(
$this
->
data
,
'chain'
));
$chain_quotation
=
[];
foreach
(
$chains
as
$key
=>
$value
)
{
$chain_quotation
[
$value
]
=
ExchangeBusiness
::
getquatation
(
$value
);
}
foreach
(
$this
->
data
as
$key
=>
$value
)
{
$this
->
data
[
$key
][
'chain_quotation'
]
=
$chain_quotation
[
$value
[
'chain'
]]
?:
null
;
}
//
$chains = array_unique(array_column($this->data, 'chain'));
//
$chain_quotation = [];
//
foreach ($chains as $key => $value) {
//
$chain_quotation[$value] = ExchangeBusiness::getquatation($value);
//
}
//
foreach ($this->data as $key => $value) {
//
$this->data[$key]['chain_quotation'] = $chain_quotation[$value['chain']] ?: null;
//
}
foreach
(
$this
->
data
as
$key
=>
&
$value
)
{
$nickname
=
json_decode
(
$value
[
'nickname'
],
true
);
$value
[
'nickname'
]
=
isset
(
$nickname
[
$this
->
lang
])
?
$nickname
[
$this
->
lang
]
:
''
;
...
...
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