Commit d7a930a5 authored by shajiaiming's avatar shajiaiming

自选行情支持币安

parent c48bd843
......@@ -100,10 +100,18 @@ class TickerController extends BaseController
$data = $temp = [];
$model = CoinOptional::find()->select('symbol, platform')->where(['device_code' => $device_code])->asArray()->all();
foreach ($model as $val) {
if('huobi' == $val['platform']) {
$exchange = 'HuoBi';
} else if ('binance' == $val['platform']) {
$exchange = 'Binance';
} else if ('zhaobi' == $val['platform']) {
$exchange = 'Zhaobi';
} else {}
$symbol = explode('/', $val['symbol']);
$tag_first = $symbol[0];
$tag_second = $symbol[1];
$exchange = 'HuoBi';
$exchange = ExchangeFactory::createExchange($exchange);
$quotation = $exchange->getTicker(strtolower($tag_first), strtolower($tag_second));
......
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