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
c843cbbd
Commit
c843cbbd
authored
Dec 25, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
26b68b3f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
BaseController.php
h5/base/BaseController.php
+20
-0
CoinController.php
h5/controllers/CoinController.php
+6
-0
No files found.
h5/base/BaseController.php
View file @
c843cbbd
...
...
@@ -15,6 +15,26 @@ class BaseController extends Controller
public
$start
;
public
$end
;
public
$header_list
=
[];
public
$lang
;
private
static
$default_header_list
=
[];
public
function
init
()
{
if
(
'cli'
!==
php_sapi_name
())
{
$this
->
header_list
=
self
::
$default_header_list
;
$this
->
fzmCrossHeader
();
}
}
public
function
fzmCrossHeader
()
{
$this
->
lang
=
\Yii
::
$app
->
request
->
headers
->
get
(
'lang'
)
??
'zh-CN'
;
if
(
'en'
==
strtolower
(
$this
->
lang
))
{
$this
->
lang
=
'en-US'
;
}
}
/**
* @param $action
* @return bool
...
...
h5/controllers/CoinController.php
View file @
c843cbbd
...
...
@@ -71,6 +71,12 @@ class CoinController extends BaseController
}
$fields
=
[
'id'
,
'sid'
,
'icon'
,
'name'
,
'nickname'
,
'platform'
,
'chain'
,
'address as contract_address'
,
'introduce'
];
$result
=
ExchangeBusiness
::
getApiListForIndex
(
1
,
999
,
$condition
,
$fields
);
foreach
(
$result
[
'data'
]
as
$key
=>
&
$val
)
{
$nickname
=
json_decode
(
$val
[
'nickname'
],
true
);
$val
[
'nickname'
]
=
isset
(
$nickname
[
$this
->
lang
])
?
$nickname
[
$this
->
lang
]
:
''
;
$introduce
=
json_decode
(
$val
[
'introduce'
],
true
);
$val
[
'introduce'
]
=
isset
(
$introduce
[
$this
->
lang
])
?
$introduce
[
$this
->
lang
]
:
''
;
}
if
(
$result
)
{
$response_
->
build
(
ResponseBuild
::
STATUS_SUCCEED
,
''
,
$result
[
'data'
]);
}
else
{
...
...
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