Commit d0598d10 authored by rlgy's avatar rlgy

update

parent 7bf7bf76
......@@ -20,12 +20,14 @@ use Yii;
/**
* 币种信息管理控制器
* Class CoinController
*
* @package api\controllers
*/
class CoinController extends BaseController
{
/**
* 单币种按照id查询
*
* @return array|null|\yii\db\ActiveRecord
*/
public function actionGetCoinById()
......@@ -49,7 +51,14 @@ class CoinController extends BaseController
$request = Yii::$app->request;
$page = $request->post('page', 1);
$limit = $request->post('limit', 999);
$platform_id = $request->post('platform_id', 1);
$platform_id = $request->post('platform_id', 2);//默认币钱包
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];
......@@ -104,6 +113,7 @@ class CoinController extends BaseController
* 矿工费获取
*
* 根据name获取
*
* @throws Exception
*/
public function actionGetMinerFeeByName()
......@@ -119,9 +129,9 @@ class CoinController extends BaseController
//如果coin为null,$coin->minerFee会抛出Trying to get property 'minerFee' of non-object",code=>8
throw new Exception('8', '币种不存在');
}
$result = (array) $miner_fee->getAttributes();
$result['min'] = (float) $result['min'];
$result['max'] = (float) $result['max'];
$result = (array)$miner_fee->getAttributes();
$result['min'] = (float)$result['min'];
$result['max'] = (float)$result['max'];
return $result;
}
......@@ -148,6 +158,7 @@ class CoinController extends BaseController
/**
* 按照名称搜索币种
*
* @return array
*/
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