Commit b5fdc15b authored by shajiaming's avatar shajiaming

支持链返回数据增加币种id

parent d3e4276e
...@@ -28,6 +28,7 @@ class SupportedChainController extends BaseController ...@@ -28,6 +28,7 @@ class SupportedChainController extends BaseController
} }
$data = []; $data = [];
foreach ($supported_chain_model as $key => &$val) { foreach ($supported_chain_model as $key => &$val) {
$data[$key]['coin_id'] = isset($val->coin->id) ? $val->coin->id : '';
$data[$key]['chain'] = isset($val->coin->chain) ? $val->coin->chain : ''; $data[$key]['chain'] = isset($val->coin->chain) ? $val->coin->chain : '';
$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 : '';
......
...@@ -46,6 +46,6 @@ class CoinSupportedChain extends BaseActiveRecord ...@@ -46,6 +46,6 @@ class CoinSupportedChain extends BaseActiveRecord
public function getCoin() public function getCoin()
{ {
return $this->hasOne(Coin::className(), ['id' => 'coin_id'])->select('name, chain, icon'); return $this->hasOne(Coin::className(), ['id' => 'coin_id'])->select('id, name, chain, icon');
} }
} }
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