Commit d7a930a5 authored by shajiaiming's avatar shajiaiming

自选行情支持币安

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