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
d0598d10
Commit
d0598d10
authored
Oct 09, 2018
by
rlgy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
7bf7bf76
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
CoinController.php
api/controllers/CoinController.php
+16
-5
No files found.
api/controllers/CoinController.php
View file @
d0598d10
...
@@ -20,12 +20,14 @@ use Yii;
...
@@ -20,12 +20,14 @@ use Yii;
/**
/**
* 币种信息管理控制器
* 币种信息管理控制器
* Class CoinController
* Class CoinController
*
* @package api\controllers
* @package api\controllers
*/
*/
class
CoinController
extends
BaseController
class
CoinController
extends
BaseController
{
{
/**
/**
* 单币种按照id查询
* 单币种按照id查询
*
* @return array|null|\yii\db\ActiveRecord
* @return array|null|\yii\db\ActiveRecord
*/
*/
public
function
actionGetCoinById
()
public
function
actionGetCoinById
()
...
@@ -49,8 +51,15 @@ class CoinController extends BaseController
...
@@ -49,8 +51,15 @@ class CoinController extends BaseController
$request
=
Yii
::
$app
->
request
;
$request
=
Yii
::
$app
->
request
;
$page
=
$request
->
post
(
'page'
,
1
);
$page
=
$request
->
post
(
'page'
,
1
);
$limit
=
$request
->
post
(
'limit'
,
999
);
$limit
=
$request
->
post
(
'limit'
,
999
);
$platform_id
=
$request
->
post
(
'platform_id'
,
1
);
$platform_id
=
$request
->
post
(
'platform_id'
,
2
);
//默认币钱包
$recommend
=
$request
->
post
(
'recommend'
,
''
);
if
(
$platform_id
==
1
)
{
$platform_id
=
3
;
}
elseif
(
$platform_id
==
2
)
{
$platform_id
=
1
;
}
elseif
(
$platform_id
==
3
)
{
$platform_id
=
2
;
}
$recommend
=
$request
->
post
(
'recommend'
,
''
);
$condition
=
[
'platform_id'
=>
$platform_id
];
$condition
=
[
'platform_id'
=>
$platform_id
];
if
(
$recommend
)
{
if
(
$recommend
)
{
...
@@ -104,6 +113,7 @@ class CoinController extends BaseController
...
@@ -104,6 +113,7 @@ class CoinController extends BaseController
* 矿工费获取
* 矿工费获取
*
*
* 根据name获取
* 根据name获取
*
* @throws Exception
* @throws Exception
*/
*/
public
function
actionGetMinerFeeByName
()
public
function
actionGetMinerFeeByName
()
...
@@ -119,9 +129,9 @@ class CoinController extends BaseController
...
@@ -119,9 +129,9 @@ class CoinController extends BaseController
//如果coin为null,$coin->minerFee会抛出Trying to get property 'minerFee' of non-object",code=>8
//如果coin为null,$coin->minerFee会抛出Trying to get property 'minerFee' of non-object",code=>8
throw
new
Exception
(
'8'
,
'币种不存在'
);
throw
new
Exception
(
'8'
,
'币种不存在'
);
}
}
$result
=
(
array
)
$miner_fee
->
getAttributes
();
$result
=
(
array
)
$miner_fee
->
getAttributes
();
$result
[
'min'
]
=
(
float
)
$result
[
'min'
];
$result
[
'min'
]
=
(
float
)
$result
[
'min'
];
$result
[
'max'
]
=
(
float
)
$result
[
'max'
];
$result
[
'max'
]
=
(
float
)
$result
[
'max'
];
return
$result
;
return
$result
;
}
}
...
@@ -148,6 +158,7 @@ class CoinController extends BaseController
...
@@ -148,6 +158,7 @@ class CoinController extends BaseController
/**
/**
* 按照名称搜索币种
* 按照名称搜索币种
*
* @return array
* @return array
*/
*/
public
function
actionSearchCoinByName
()
public
function
actionSearchCoinByName
()
...
...
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