base_url . '/open/api/get_allticker'; $res = $curl->get($api, false); if (is_array($res) && isset($res['data'])) { $data = $res['data']['ticker']; foreach ($data as $key => $item) { #if (in_array(strtoupper($item['symbol']), ['BNCUSAT', 'BTCUSAT', 'ETCUSAT', 'ETHUSAT', 'GHPUSAT', 'LTCUSAT', 'BNCUSDT'])) { $low = isset($item['low']) ? $item['low'] : 0; $high = isset($item['high']) ? $item['high'] : 0; $last = isset($item['last']) ? $item['last'] : 0; $open = isset($item['last']) ? $item['last'] : 0; $vol = isset($item['vol']) ? $item['vol'] : 0; $change = isset($item['rose']) ? $item['rose'] : 0; $cache_key = strtolower($this->quotation_prefix . $item['symbol']); $this->redis->hmset($cache_key, 'low', $low, 'high', $high, 'last', $last, 'open', $open, 'vol', $vol, 'change', $change); $this->redis->sadd($this->supported_symbol, strtoupper($item['symbol'])); #} } } } }