Commit d0598d10 authored by rlgy's avatar rlgy

update

parent 7bf7bf76
...@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment