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
7fd2bcba
Commit
7fd2bcba
authored
Jul 30, 2018
by
rlgy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
推介币种返回信息格式更改
parent
3ab7f39a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
CoinController.php
api/controllers/CoinController.php
+2
-2
ExchangeBusiness.php
common/business/ExchangeBusiness.php
+4
-3
No files found.
api/controllers/CoinController.php
View file @
7fd2bcba
...
...
@@ -49,7 +49,7 @@ class CoinController extends BaseController
$page
=
$request
->
post
(
'page'
,
1
);
$limit
=
$request
->
post
(
'limit'
,
999
);
$condition
=
[[
'recommend'
=>
'1'
]];
return
ExchangeBusiness
::
getApiListForIndex
(
$condition
);
return
ExchangeBusiness
::
getApiListForIndex
(
$
page
,
$limit
,
$
condition
);
}
/**
...
...
@@ -84,7 +84,7 @@ class CoinController extends BaseController
{
$names
=
Yii
::
$app
->
request
->
post
(
'names'
);
$condition
=
[[
'in'
,
'name'
,
$names
]];
return
ExchangeBusiness
::
getApiListForIndex
(
$condition
);
return
ExchangeBusiness
::
getApiListForIndex
(
1
,
999
,
$condition
);
}
/**
...
...
common/business/ExchangeBusiness.php
View file @
7fd2bcba
...
...
@@ -118,9 +118,10 @@ class ExchangeBusiness
* @param array $condition 需要的币种sid列表
* @return array
*/
public
static
function
getApiListForIndex
(
$condition
=
[])
public
static
function
getApiListForIndex
(
$
page
=
1
,
$limit
=
999
,
$
condition
=
[])
{
$rows
=
Coin
::
getSelectList
(
1
,
999
,
[
'id'
,
'sid'
,
'icon'
,
'name'
,
'nickname'
,
'platform'
,
'chain'
],
$condition
);
$rows
=
Coin
::
getSelectList
(
$page
,
$limit
,
[
'id'
,
'sid'
,
'icon'
,
'name'
,
'nickname'
,
'platform'
,
'chain'
],
$condition
);
$count
=
$rows
[
'count'
]
??
0
;
if
(
$rows
[
'count'
]
>
0
)
{
$rows
=
$rows
[
'data'
];
foreach
(
$rows
as
$key
=>
$row
)
{
...
...
@@ -147,7 +148,7 @@ class ExchangeBusiness
}
$rows
[
$key
]
=
array_merge
(
$rows
[
$key
],
$quotation
);
}
return
$rows
;
return
[
'code'
=>
0
,
'count'
=>
$count
,
'data'
=>
$rows
]
;
}
return
[];
}
...
...
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