base_url . '/v1/hadax/common/symbols'; $res = $curl->get($api, false);//json if ($res && $res['status'] == 'ok') { $data = $res['data']; foreach ($data as $item) { $this->redis->sadd($this->supported_symbol, $this->formatSymbol($item['base-currency'], $item['quote-currency'])); } } } public function setQuotation() { $curl = new Curl(); $api = $this->base_url . '/market/tickers'; $res = $curl->get($api, false); if ($res && $res['status'] == 'ok') { $datas = $res['data']; foreach ($datas as $item) { $key = $this->quotation_prefix . $item['symbol']; $this->redis->hmset($key, 'low', $item['low'], 'high', $item['high'], 'last', $item['close']); $this->redis->sadd($this->supported_symbol, $item['symbol']); } } } }