Commit c171a727 authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/ticker' into 'master'

xjh ticker See merge request !276
parents 0e16c28d 1ca154c2
...@@ -220,9 +220,9 @@ class ExchangeBusiness ...@@ -220,9 +220,9 @@ class ExchangeBusiness
goto doEnd; goto doEnd;
} }
if (in_array(strtoupper($tag), ['STH'])) { if (in_array(strtoupper($tag), ['STH', 'XJH'])) {
$exchange = ExchangeFactory::createExchange("Coinka"); $exchange = ExchangeFactory::createExchange("Coinka");
$quotation = $exchange->getTicker('sth', 'usdt'); $quotation = $exchange->getTicker(strtolower($tag), 'usdt');
goto doEnd; goto doEnd;
} }
......
...@@ -60,7 +60,7 @@ class Coinka extends Exchange implements ExchangeInterface ...@@ -60,7 +60,7 @@ class Coinka extends Exchange implements ExchangeInterface
if (is_array($content) && isset($content['ticker'])) { if (is_array($content) && isset($content['ticker'])) {
$data = $content['ticker']; $data = $content['ticker'];
foreach ($data as $item) { foreach ($data as $item) {
if (in_array(strtoupper($item['symbol']), ['STH_USDT'])) { if (in_array(strtoupper($item['symbol']), ['STH_USDT', 'XJH_USDT'])) {
$data = $item; $data = $item;
$key = $this->quotation_prefix . $item['symbol']; $key = $this->quotation_prefix . $item['symbol'];
$this->redis->hmset($key, 'low', $data['low'], 'high', $data['high'], 'last', $data['last'], 'change', $data['change'], 'vol', $data['vol']); $this->redis->hmset($key, 'low', $data['low'], 'high', $data['high'], 'last', $data['last'], 'change', $data['change'], 'vol', $data['vol']);
......
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