Commit d61efc09 authored by shajiaiming's avatar shajiaiming

C2C币种列表

parent 2af4d47a
......@@ -51,21 +51,27 @@ class SupportedSymbolController extends BaseController
$temp['rmb'] = isset($res[$val->currency]['rmb']) ? $res[$val->currency]['rmb'] : 0.00;
$temp['usd'] = isset($res[$val->currency]['usd']) ? $res[$val->currency]['usd'] : 0.00;
array_push($market, $temp);
$coin_name[] = $val->coinInfo->name;
}
$coin_name = [];
foreach ($market as &$val) {
$childSupportedSymbol = CoinSupportedSymbol::find()->where(['platform_id' => $platform_id, 'currency' => $val['id']])->all();
$tokens = [];
foreach ($childSupportedSymbol as $child) {
$coin_name[] = $child->baseCurrencyInfo->name;
}
$data_child = [
"names" => $coin_name
];
$params = json_encode($data_child);
$curl = new Curl();
$curl->setHeader('Content-Type', 'application/json');
$curl->setRawPostData($params);
$res = $curl->post(\Yii::$app->params['biqianbao'].'/interface/coin/coin-index', true);
$res = json_decode($res, true);
$res = array_column($res['data'],NULL,'id');;
foreach ($childSupportedSymbol as $child) {
$curl = new Curl();
$data = [
"names" => [$child->baseCurrencyInfo->name]
];
$params = json_encode($data);
$curl->setHeader('Content-Type', 'application/json');
$curl->setRawPostData($params);
$res = $curl->post(\Yii::$app->params['biqianbao'].'/interface/coin/coin-index', true);
$res = json_decode($res, true);
$temp = [];
$temp['id'] = (int)$child->base_currency;
$temp['name'] = $child->baseCurrencyInfo->name;
......@@ -74,8 +80,8 @@ class SupportedSymbolController extends BaseController
$temp['isParacross'] = ('BTY' == strtoupper($child->baseCurrencyInfo->platform)) ? false : true;
$temp['url'] = 'http://www.huifen.com';
$temp['platfrom'] = $child->baseCurrencyInfo->platform;
$temp['rmb'] = isset($res['data'][0]['rmb']) ? $res['data'][0]['rmb'] : 0.00;
$temp['usd'] = isset($res['data'][0]['usd']) ? $res['data'][0]['usd'] : 0.00;
$temp['rmb'] = isset($res[$child->base_currency]['rmb']) ? $res[$child->base_currency]['rmb'] : 0.00;
$temp['usd'] = isset($res[$child->base_currency]['usd']) ? $res[$child->base_currency]['usd'] : 0.00;
array_push($tokens, $temp);
}
$val['tokens'] = $tokens;
......
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