Commit 4f1bc425 authored by shajiaiming's avatar shajiaiming

fix

parents 85cec1b1 b6c49414
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
namespace api\controllers; namespace api\controllers;
use common\business\ExchangeBusiness;
use Yii; use Yii;
use api\base\BaseController; use api\base\BaseController;
use common\models\psources\CoinSupportedChain; use common\models\psources\CoinSupportedChain;
...@@ -29,29 +28,10 @@ class SupportedChainController extends BaseController ...@@ -29,29 +28,10 @@ class SupportedChainController extends BaseController
} }
$data = []; $data = [];
foreach ($supported_chain_model as $key => &$val) { foreach ($supported_chain_model as $key => &$val) {
$data[$key]['id'] = isset($val->coin->id) ? $val->coin->id : ''; $data[$key]['chain'] = isset($val->coin->chain) ? $val->coin->chain : '';
$data[$key]['name'] = isset($val->coin->name) ? $val->coin->name : '';
$data[$key]['icon'] = isset($val->coin->icon) ? $val->coin->icon : ''; $data[$key]['icon'] = isset($val->coin->icon) ? $val->coin->icon : '';
$data[$key]['name'] = isset($val->coin->name) ? $val->coin->name : ''; $data[$key]['name'] = isset($val->coin->name) ? $val->coin->name : '';
$data[$key]['sid'] = isset($val->coin->sid) ? $val->coin->sid : '';
$data[$key]['nickname'] = isset($val->coin->nickname[$this->lang]) ? $val->coin->nickname[$this->lang] : '';
$data[$key]['chain'] = isset($val->coin->chain) ? $val->coin->chain : '';
$data[$key]['platform'] = isset($val->coin->platform) ? $val->coin->platform : ''; $data[$key]['platform'] = isset($val->coin->platform) ? $val->coin->platform : '';
$data[$key]['sort'] = isset($val->coin->sort) ? $val->coin->sort : 0;
$data[$key]['treaty'] = isset($val->coin->treaty) ? $val->coin->treaty : '';
$data[$key]['optional_name'] = isset($val->coin->optional_name) ? $val->coin->optional_name : '';
$data[$key]['rmb'] = 0;
$data[$key]['usd'] = 0;
$ticker = ExchangeBusiness::getquatation($val->coin->name);
if (false != $ticker) {
$data[$key]['rmb'] = $ticker['rmb'];
$data[$key]['usd'] = $ticker['usd'];
}
} }
$msg = 'success'; $msg = 'success';
$code = 0; $code = 0;
......
...@@ -46,7 +46,6 @@ class CoinSupportedChain extends BaseActiveRecord ...@@ -46,7 +46,6 @@ class CoinSupportedChain extends BaseActiveRecord
public function getCoin() public function getCoin()
{ {
return $this->hasOne(Coin::className(), ['id' => 'coin_id']) return $this->hasOne(Coin::className(), ['id' => 'coin_id'])->select('name, chain, icon, platform');
->select('id, sid, icon, name, introduce, optional_name, nickname, platform, chain, treaty');
} }
} }
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