Commit 737b1d47 authored by shajiaiming's avatar shajiaiming

lele ticker

parent 581aae61
......@@ -26,23 +26,23 @@ class ExchangeBusiness
* @var array
*/
private static $exchanges = [
0 => 'Bty',
1 => 'HuoBi',
2 => 'Hadax',
3 => 'Bitfinex',
4 => 'Bittrex',
5 => 'Zb',
6 => 'Zg',
7 => 'Go',
8 => 'Zhaobi',
9 => 'Binance',
10 => 'Bilaxy',
11 => 'Bitnasdaq',
12 => 'Isummit',
13 => 'Boc',
14 => 'Jinwang',
15 => 'Hd',
16 => 'Ztb',
// 0 => 'Bty',
// 1 => 'HuoBi',
// 2 => 'Hadax',
// 3 => 'Bitfinex',
// 4 => 'Bittrex',
// 5 => 'Zb',
// 6 => 'Zg',
// 7 => 'Go',
// 8 => 'Zhaobi',
// 9 => 'Binance',
// 10 => 'Bilaxy',
// 11 => 'Bitnasdaq',
// 12 => 'Isummit',
// 13 => 'Boc',
// 14 => 'Jinwang',
// 15 => 'Hd',
// 16 => 'Ztb',
17 => 'Wbf'
//1 => 'Hadax', //不需要
......
......@@ -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