Commit b179154f authored by shajiaiming's avatar shajiaiming

test

parent 50d23069
...@@ -14,6 +14,7 @@ class HuobiBuilder extends FactoryService ...@@ -14,6 +14,7 @@ class HuobiBuilder extends FactoryService
{ {
protected $base_url = 'https://api.huobi.pro'; protected $base_url = 'https://api.huobi.pro';
protected $supported_symbol = 'supported_symbol_huobi'; protected $supported_symbol = 'supported_symbol_huobi';
protected $supported_symbol_list = 'supported_symbol_huobi_list';
protected $quotation_prefix = 'quotation_huobi_'; protected $quotation_prefix = 'quotation_huobi_';
public function getTicker() public function getTicker()
...@@ -56,6 +57,18 @@ class HuobiBuilder extends FactoryService ...@@ -56,6 +57,18 @@ class HuobiBuilder extends FactoryService
public function getTickerFromCache() public function getTickerFromCache()
{ {
$keys = $this->redis->smembers($this->supported_symbol); $keys = $this->redis->smembers($this->supported_symbol);
if (false == $this->redis->exists($this->supported_symbol_list)) {
foreach ($keys as $val) {
foreach ($this->basic_coin as $k => $coin) {
$explode_arr = explode(strtolower($coin), $val);
if (2 == count($explode_arr) && empty($explode_arr[1])) {
$this->redis->lpush($this->supported_symbol_list, $val);
}
}
}
}
$keys = $this->redis->lrange($this->supported_symbol_list, 0, 50);
$ticker = []; $ticker = [];
foreach ($keys as $val) { foreach ($keys as $val) {
foreach ($this->basic_coin as $k => $coin) { foreach ($this->basic_coin as $k => $coin) {
......
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