Commit 8b96e71c authored by shajiaiming's avatar shajiaiming

test

parent 61632c83
...@@ -118,6 +118,7 @@ class HuobiBuilder extends FactoryService ...@@ -118,6 +118,7 @@ class HuobiBuilder extends FactoryService
$temp['close'] = number_format($close, 6, '.', ''); $temp['close'] = number_format($close, 6, '.', '');
$temp['low'] = $low; $temp['low'] = $low;
$temp['high'] = $high; $temp['high'] = $high;
$temp['open'] = $open;
$temp['vol'] = $vol; $temp['vol'] = $vol;
$temp['change'] = (0 == $open) ? 0 : (float)sprintf("%0.2f", ($close - $open) / $open * 100); $temp['change'] = (0 == $open) ? 0 : (float)sprintf("%0.2f", ($close - $open) / $open * 100);
array_push($ticker, $temp); array_push($ticker, $temp);
...@@ -128,7 +129,7 @@ class HuobiBuilder extends FactoryService ...@@ -128,7 +129,7 @@ class HuobiBuilder extends FactoryService
$this->redis_ticker->hmset($key, 'low', $val['low'], 'high', $val['high'], 'last', $val['close'], 'open', $val['open'], 'vol', $val['vol']); $this->redis_ticker->hmset($key, 'low', $val['low'], 'high', $val['high'], 'last', $val['close'], 'open', $val['open'], 'vol', $val['vol']);
$this->redis_ticker->sadd($this->supported_symbol, $val['symbol']); $this->redis_ticker->sadd($this->supported_symbol, $val['symbol']);
$this->redis_ticker->lpush($this->supported_symbol_list, $val); $this->redis_ticker->lpush($this->supported_symbol_close_sort, strtoupper($val['symbol']));
} }
$ticker_change_close = $this->arraySort($ticker, 'change'); $ticker_change_close = $this->arraySort($ticker, 'change');
foreach ($ticker_change_close as $val) { foreach ($ticker_change_close as $val) {
...@@ -136,7 +137,7 @@ class HuobiBuilder extends FactoryService ...@@ -136,7 +137,7 @@ class HuobiBuilder extends FactoryService
$this->redis_ticker->hmset($key, 'low', $val['low'], 'high', $val['high'], 'last', $val['close'], 'open', $val['open'], 'vol', $val['vol']); $this->redis_ticker->hmset($key, 'low', $val['low'], 'high', $val['high'], 'last', $val['close'], 'open', $val['open'], 'vol', $val['vol']);
$this->redis_ticker->sadd($this->supported_symbol, $val['symbol']); $this->redis_ticker->sadd($this->supported_symbol, $val['symbol']);
$this->redis_ticker->lpush($this->supported_symbol_list, $val); $this->redis_ticker->lpush($this->supported_symbol_change_sort, strtoupper($val['symbol']));
} }
} }
......
...@@ -14,7 +14,7 @@ class TickerController extends Controller ...@@ -14,7 +14,7 @@ class TickerController extends Controller
{ {
public function actionSort() public function actionSort()
{ {
$class = ['Binance', 'Huobi', 'Zhaobi']; $class = ['Huobi'];
foreach ($class as $val) { foreach ($class as $val) {
go(function () use ($val) { go(function () use ($val) {
\Co::sleep(0.5); \Co::sleep(0.5);
......
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