Commit 3b909050 authored by rlgy's avatar rlgy

update

parent 1db40631
...@@ -28,6 +28,7 @@ class Bty extends Exchange implements ExchangeInterface ...@@ -28,6 +28,7 @@ class Bty extends Exchange implements ExchangeInterface
/** /**
* 保存支持的交易对到redis数据库,使用crontab定时更新 * 保存支持的交易对到redis数据库,使用crontab定时更新
*
* @return mixed|void * @return mixed|void
*/ */
public function setSupportedSymbol() public function setSupportedSymbol()
...@@ -37,6 +38,7 @@ class Bty extends Exchange implements ExchangeInterface ...@@ -37,6 +38,7 @@ class Bty extends Exchange implements ExchangeInterface
/** /**
* 更新交易对行情保存到redis,使用crontab定时更新 * 更新交易对行情保存到redis,使用crontab定时更新
*
* @return mixed|void * @return mixed|void
*/ */
public function setQuotation() public function setQuotation()
...@@ -45,14 +47,13 @@ class Bty extends Exchange implements ExchangeInterface ...@@ -45,14 +47,13 @@ class Bty extends Exchange implements ExchangeInterface
if (is_array($content) && isset($content['code']) && $content['code'] == 200) { if (is_array($content) && isset($content['code']) && $content['code'] == 200) {
$data = $content['data']['USDT']; $data = $content['data']['USDT'];
foreach ($data as $item) { foreach ($data as $item) {
if ($item['symbol'] == 'BTYUSDT') { if ($item['symbol'] == 'BTYUSDT' || $item['symbol'] == 'ITVBUSDT') {
$data = $item; $data = $item;
break; $key = $this->quotation_prefix . $item['symbol'];
$this->redis->hmset($key, 'low', $data['low'], 'high', $data['high'], 'last', $data['last'], 'rmb', $data['lastrmb']);
$this->redis->sadd($this->supported_symbol, $item['symbol']);
} }
} }
$key = $this->quotation_prefix . 'BTYUSDT';
$this->redis->hmset($key, 'low', $data['low'], 'high', $data['high'], 'last', $data['last'], 'rmb', $data['lastrmb']);
$this->redis->sadd($this->supported_symbol, $item['symbol']);
} }
} }
......
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