Commit d8c5ea90 authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/ticker' into 'master'

fix See merge request !390
parents 322e8854 3e2fca9d
......@@ -36,7 +36,7 @@ class Bitnasdaq extends Exchange implements ExchangeInterface
if (is_array($res) && isset($res['data'])) {
$data = $res['data']['ticker'];
foreach ($data as $key => $item) {
if (in_array(strtoupper($item['symbol']), ['BNCUSAT', 'BTCUSAT', 'ETCUSAT', 'ETHUSAT', 'GHPUSAT', 'LTCUSAT'])) {
if (in_array(strtoupper($item['symbol']), ['BNCUSAT', 'BTCUSAT', 'ETCUSAT', 'ETHUSAT', 'GHPUSAT', 'LTCUSAT', 'BNCUSDT'])) {
$low = isset($item['low']) ? $item['low'] : 0;
$high = isset($item['high']) ? $item['high'] : 0;
$last = isset($item['last']) ? $item['last'] : 0;
......
......@@ -154,7 +154,7 @@ class BitnasdaqBuilder extends FactoryService
$ticker = [];
foreach ($symbol as $val) {
list($low, $high, $close, $open, $vol) = $this->redis->hmget($this->quotation_prefix . strtolower($val), 'low', 'high', 'last', 'open', 'vol');
list($low, $high, $close, $open, $change, $vol) = $this->redis->hmget($this->quotation_prefix . strtolower($val), 'low', 'high', 'last', 'open', 'change', 'vol');
$explode_arr = explode('usdt', $val);
$temp = [];
$temp['symbol'] = strtoupper($explode_arr[0]) . '/USDT';
......@@ -163,7 +163,7 @@ class BitnasdaqBuilder extends FactoryService
$temp['close'] = (float)sprintf("%0.6f", $close);
$temp['close_usd'] = (float)sprintf("%0.6f", $close * $this->basic_price['USDT']['usd']);
$temp['close_rmb'] = (float)sprintf("%0.4f", $close * $this->basic_price['USDT']['rmb']);
$temp['change'] = (0 == $open) ? 0 : (float)sprintf("%0.2f", ($close - $open) / $open * 100);
$temp['change'] = (float)sprintf("%0.2f", $change * 100);
$temp['high_usd'] = (float)sprintf("%0.4f", $high * $this->basic_price['USDT']['usd']);
$temp['low_usd'] = (float)sprintf("%0.4f", $low * $this->basic_price['USDT']['usd']);
$temp['high_rmb'] = (float)sprintf("%0.4f", $high * $this->basic_price['USDT']['rmb']);
......
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