Commit aea99a0b authored by shajiaiming's avatar shajiaiming

行情返回值 调整

parent 99516fd4
......@@ -88,6 +88,7 @@ class BinanceBuilder extends FactoryService
$temp['currency'] = strtoupper($explode_arr[0]);
$temp['base_currency'] = strtoupper($coin);
$temp['close'] = number_format($close, 6, '.', '');
if ('0.000000' == $temp['close']) continue;
$temp['close_usd'] = (float)sprintf("%0.6f", $close * $this->basic_price[$coin]['usd']);
$temp['close_rmb'] = (float)sprintf("%0.4f", $close * $this->basic_price[$coin]['rmb']);
$temp['change'] = (0 == $open) ? 0 : (float)sprintf("%0.2f", ($close - $open) / $open * 100);
......
......@@ -33,8 +33,7 @@ class HuobiBuilder extends FactoryService
$res = $curl->get($api, false);
if (isset($res['status']) && 'ok' == $res['status']) {
$key = $this->quotation_prefix . $symbol;
$this->redis->hmset($key, 'low', $res['tick']['low'], 'high', $res['tick']['high'], 'last', $res['tick']['close'], 'open', $res['tick']['open'], 'vol', $res['tick']['
vol']);
$this->redis->hmset($key, 'low', $res['tick']['low'], 'high', $res['tick']['high'], 'last', $res['tick']['close'], 'open', $res['tick']['open'], 'vol', $res['tick']['vol']);
$this->redis->sadd($this->supported_symbol, $symbol);
}
}
......@@ -72,6 +71,7 @@ vol']);
$temp['currency'] = strtoupper($explode_arr[0]);
$temp['base_currency'] = strtoupper($coin);
$temp['close'] = number_format($close, 6, '.', '');
if ('0.000000' == $temp['close']) continue;
$temp['close_usd'] = (float)sprintf("%0.6f", $close * $this->basic_price[$coin]['usd']);
$temp['close_rmb'] = (float)sprintf("%0.4f", $close * $this->basic_price[$coin]['rmb']);
$temp['change'] = (false == $open) ? 0 : (float)sprintf("%0.2f", ($close - $open) / $open * 100);
......
......@@ -39,6 +39,7 @@ class ZhaobiBuilder extends FactoryService
$temp['currency'] = strtoupper($explode_arr[0]);
$temp['base_currency'] = strtoupper($coin);
$temp['close'] = number_format($val['last'], 6, '.', '');
if ('0.000000' == $temp['close']) continue;
$temp['close_usd'] = (float)sprintf("%0.6f", $val['last'] * $this->basic_price[$coin]['usd']);
$temp['close_rmb'] = (float)sprintf("%0.4f", $val['last'] * $this->basic_price[$coin]['rmb']);
$temp['change'] = (0 == $val['open']) ? 0 : (float)sprintf("%0.2f", ($val['last'] - $val['open']) / $val['open'] * 100);
......
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