Commit 6f2bd666 authored by ZhuChunYang's avatar ZhuChunYang

获取币种主链

parent 89fc89b2
...@@ -130,4 +130,15 @@ class ServiceController extends BaseController ...@@ -130,4 +130,15 @@ class ServiceController extends BaseController
return (float)$rate['rmb'] / $rate['last']; return (float)$rate['rmb'] / $rate['last'];
} }
public function actionChain()
{
$request = Yii::$app->request;
$currency = $request->post('currency','');
$coin = Coin::find()->where(['name' => $currency])->select('name,nickname,chain')->asArray()->one();
if($coin){
return ['code' => 0,'data' => $coin];
}
return ['code' => -1,'msg' => '币种不存在'];
}
} }
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