Commit c293a438 authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/ticker' into 'master'

Feature/ticker See merge request !434
parents 7e1f2ea4 6fb3c7e3
......@@ -59,7 +59,12 @@ class Wbf extends Exchange implements ExchangeInterface
$data = $res['data']['ticker'];
foreach ($data as $item) {
$key = $this->quotation_prefix . strtoupper($item['symbol']);
$this->redis->hmset($key, 'low', $item['low'], 'high', $item['high'], 'last', $item['last'], 'vol', $item['vol'], 'change', $item['change']);
$low = isset($item['low']) ? $item['low'] : 0;
$high = isset($item['high']) ? $item['high'] : 0;
$last = isset($item['last']) ? $item['last'] : 0;
$vol = isset($item['vol']) ? $item['vol'] : 0;
$change = isset($item['change']) ? $item['change'] : 0;
$this->redis->hmset($key, 'low', $low, 'high', $high, 'last', $last, 'vol', $vol, 'change', $change);
if (!$this->redis->sismember($this->supported_symbol, strtoupper($item['symbol']))){
$this->redis->sadd($this->supported_symbol, strtoupper($item['symbol']));
}
......
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