Commit 492173a0 authored by shajiaiming's avatar shajiaiming

fix

parent a54df6a1
......@@ -28,9 +28,10 @@ class SupportedChainController extends BaseController
}
$data = [];
foreach ($supported_chain_model as $key => &$val) {
$data[] = !empty($val->coin) ? $val->coin : '';
}
$data[$key]['chain'] = isset($val->coin->chain) ? $val->coin->chain : '';
$data[$key]['icon'] = isset($val->coin->icon) ? $val->coin->icon : '';
}
$msg = 'success';
$code = 0;
doEnd :
......
......@@ -41,11 +41,11 @@ class CoinSupportedChain extends BaseActiveRecord
public function attributes()
{
return array_merge(parent::attributes(), ['coins']);
return array_merge(parent::attributes(), ['chain', 'icon']);
}
public function getCoin()
{
return $this->hasOne(Coin::className(), ['id' => 'coin_id'])->select('name as chain');
return $this->hasOne(Coin::className(), ['id' => 'coin_id'])->select('name as 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