Commit 3e2fca9d authored by shajiaiming's avatar shajiaiming

fix

parent 2755cf58
...@@ -36,7 +36,7 @@ class Bitnasdaq extends Exchange implements ExchangeInterface ...@@ -36,7 +36,7 @@ class Bitnasdaq extends Exchange implements ExchangeInterface
if (is_array($res) && isset($res['data'])) { if (is_array($res) && isset($res['data'])) {
$data = $res['data']['ticker']; $data = $res['data']['ticker'];
foreach ($data as $key => $item) { 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; $low = isset($item['low']) ? $item['low'] : 0;
$high = isset($item['high']) ? $item['high'] : 0; $high = isset($item['high']) ? $item['high'] : 0;
$last = isset($item['last']) ? $item['last'] : 0; $last = isset($item['last']) ? $item['last'] : 0;
......
...@@ -154,7 +154,7 @@ class BitnasdaqBuilder extends FactoryService ...@@ -154,7 +154,7 @@ class BitnasdaqBuilder extends FactoryService
$ticker = []; $ticker = [];
foreach ($symbol as $val) { 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); $explode_arr = explode('usdt', $val);
$temp = []; $temp = [];
$temp['symbol'] = strtoupper($explode_arr[0]) . '/USDT'; $temp['symbol'] = strtoupper($explode_arr[0]) . '/USDT';
...@@ -163,7 +163,7 @@ class BitnasdaqBuilder extends FactoryService ...@@ -163,7 +163,7 @@ class BitnasdaqBuilder extends FactoryService
$temp['close'] = (float)sprintf("%0.6f", $close); $temp['close'] = (float)sprintf("%0.6f", $close);
$temp['close_usd'] = (float)sprintf("%0.6f", $close * $this->basic_price['USDT']['usd']); $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['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['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['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']); $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