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
d82c2476
Commit
d82c2476
authored
Aug 08, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add return column
parent
7e653cc9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
ExchangeBusiness.php
common/business/ExchangeBusiness.php
+3
-3
CoinController.php
h5/controllers/CoinController.php
+6
-6
No files found.
common/business/ExchangeBusiness.php
View file @
d82c2476
...
@@ -271,20 +271,20 @@ class ExchangeBusiness
...
@@ -271,20 +271,20 @@ class ExchangeBusiness
if
(
count
(
$condition
[
0
])
>
1
)
{
if
(
count
(
$condition
[
0
])
>
1
)
{
foreach
(
$condition
as
$val
)
{
foreach
(
$condition
as
$val
)
{
if
(
'null'
==
$val
[
1
]
||
'coin'
==
$val
[
1
])
{
if
(
'null'
==
$val
[
1
]
||
'coin'
==
$val
[
1
])
{
$data
[]
=
Coin
::
find
()
->
select
(
'id,sid,icon,name,optional_name,nickname,platform,chain,address as contract_address,treaty'
)
$data
[]
=
Coin
::
find
()
->
select
(
'id,sid,icon,name,optional_name,nickname,
introduce,
platform,chain,address as contract_address,treaty'
)
->
where
([
'name'
=>
$val
[
0
]])
->
where
([
'name'
=>
$val
[
0
]])
->
asArray
()
->
asArray
()
->
one
();
->
one
();
continue
;
continue
;
}
}
$data
[]
=
Coin
::
find
()
->
select
(
'id,sid,icon,name,optional_name,nickname,platform,chain,address as contract_address,treaty'
)
$data
[]
=
Coin
::
find
()
->
select
(
'id,sid,icon,name,optional_name,nickname,
introduce,
platform,chain,address as contract_address,treaty'
)
->
where
([
'name'
=>
$val
[
0
]])
->
where
([
'name'
=>
$val
[
0
]])
->
andWhere
([
'platform'
=>
$val
[
1
]])
->
andWhere
([
'platform'
=>
$val
[
1
]])
->
asArray
()
->
asArray
()
->
one
();
->
one
();
}
}
}
else
{
}
else
{
$data
=
Coin
::
find
()
->
select
(
'id,sid,icon,name,optional_name,nickname,platform,chain,address as contract_address,treaty'
)
$data
=
Coin
::
find
()
->
select
(
'id,sid,icon,name,optional_name,nickname,
introduce,
platform,chain,address as contract_address,treaty'
)
->
where
([
'in'
,
'name'
,
$condition
])
->
where
([
'in'
,
'name'
,
$condition
])
->
asArray
()
->
all
();
->
asArray
()
->
all
();
}
}
...
...
h5/controllers/CoinController.php
View file @
d82c2476
...
@@ -29,7 +29,7 @@ class CoinController extends BaseController
...
@@ -29,7 +29,7 @@ class CoinController extends BaseController
public
function
actionGetIconByNames
()
public
function
actionGetIconByNames
()
{
{
$response_
=
new
ResponseBuild
();
$response_
=
new
ResponseBuild
();
$names
=
Yii
::
$app
->
request
->
POST
(
'names'
);
$names
=
Yii
::
$app
->
request
->
POST
(
'names'
);
if
(
empty
(
$names
))
{
if
(
empty
(
$names
))
{
$response_
->
build
(
ResponseBuild
::
STATUS_PARAMS_NOT_VALIDATE
);
$response_
->
build
(
ResponseBuild
::
STATUS_PARAMS_NOT_VALIDATE
);
return
$response_
;
return
$response_
;
...
@@ -38,7 +38,7 @@ class CoinController extends BaseController
...
@@ -38,7 +38,7 @@ class CoinController extends BaseController
$names
=
[
$names
];
$names
=
[
$names
];
}
}
$infos
=
Coin
::
getInfoByNames
(
$names
);
$infos
=
Coin
::
getInfoByNames
(
$names
);
$data
=
[];
$data
=
[];
if
(
$infos
)
{
if
(
$infos
)
{
$data
=
array_column
(
$infos
,
'icon'
,
'name'
);
$data
=
array_column
(
$infos
,
'icon'
,
'name'
);
}
}
...
@@ -53,7 +53,7 @@ class CoinController extends BaseController
...
@@ -53,7 +53,7 @@ class CoinController extends BaseController
public
function
actionCoinInfoByNames
()
public
function
actionCoinInfoByNames
()
{
{
$response_
=
new
ResponseBuild
();
$response_
=
new
ResponseBuild
();
$names
=
Yii
::
$app
->
request
->
POST
(
'names'
);
$names
=
Yii
::
$app
->
request
->
POST
(
'names'
);
if
(
empty
(
$names
))
{
if
(
empty
(
$names
))
{
$response_
->
build
(
ResponseBuild
::
STATUS_PARAMS_NOT_VALIDATE
);
$response_
->
build
(
ResponseBuild
::
STATUS_PARAMS_NOT_VALIDATE
);
return
$response_
;
return
$response_
;
...
@@ -62,11 +62,11 @@ class CoinController extends BaseController
...
@@ -62,11 +62,11 @@ class CoinController extends BaseController
$names
=
[
$names
];
$names
=
[
$names
];
}
}
$condition
=
$names
;
$condition
=
$names
;
$fields
=
[
'id'
,
'sid'
,
'icon'
,
'name'
,
'nickname'
,
'platform'
,
'chain'
,
'address as contract_address'
,
'introduce'
];
$fields
=
[
'id'
,
'sid'
,
'icon'
,
'name'
,
'nickname'
,
'platform'
,
'chain'
,
'address as contract_address'
,
'introduce'
];
$result
=
ExchangeBusiness
::
getApiListForIndex
(
1
,
999
,
$condition
,
$fields
);
$result
=
ExchangeBusiness
::
getApiListForIndex
(
1
,
999
,
$condition
,
$fields
);
if
(
$result
)
{
if
(
$result
)
{
$response_
->
build
(
ResponseBuild
::
STATUS_SUCCEED
,
''
,
$result
[
'data'
]);
$response_
->
build
(
ResponseBuild
::
STATUS_SUCCEED
,
''
,
$result
[
'data'
]);
}
else
{
}
else
{
$response_
->
build
(
ResponseBuild
::
STATUS_SUCCEED
,
''
,
[]);
$response_
->
build
(
ResponseBuild
::
STATUS_SUCCEED
,
''
,
[]);
}
}
return
$response_
;
return
$response_
;
...
...
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