Commit 315043b1 authored by shajiaiming's avatar shajiaiming

hd to hdc

parent f06e90cb
......@@ -378,7 +378,7 @@ class TickerController extends BaseController
], [
'exchange' => 'hd',
'symbol' => [
'hdusdt'
'hdcusdt'
],
]
];
......
......@@ -16,7 +16,7 @@ class Hd extends Exchange implements ExchangeInterface
protected $quotation_prefix = 'quotation_hd_';
protected $base_url = 'https://app.honordecent.com/exchange/getHdcCurrPrice';
public function symbolExists($tag = 'HD', $aim = "USDT")
public function symbolExists($tag = 'HDC', $aim = "USDT")
{
$supported = $this->redis->smembers($this->supported_symbol);
if (is_array($supported) && in_array($this->formatSymbol($tag, $aim), $supported)) {
......@@ -32,7 +32,7 @@ class Hd extends Exchange implements ExchangeInterface
* @param string $aim
* @return mixed
*/
public function formatSymbol($tag = 'HD', $aim = 'USDT')
public function formatSymbol($tag = 'HDC', $aim = 'USDT')
{
return strtoupper($tag . $aim);
}
......@@ -57,10 +57,10 @@ class Hd extends Exchange implements ExchangeInterface
$curl = new Curl();
$res = $curl->get($this->base_url, false);
if (is_array($res) && 1 == $res['code']) {
$key = $this->quotation_prefix . 'HDUSDT';
$key = $this->quotation_prefix . 'HDCUSDT';
$this->redis->hmset($key, 'low', $res['data'], 'high', $res['data'], 'last', $res['data']);
if (!$this->redis->sismember($this->supported_symbol, 'HDUSDT')) {
$this->redis->sadd($this->supported_symbol, 'HDUSDT');
if (!$this->redis->sismember($this->supported_symbol, 'HDCUSDT')) {
$this->redis->sadd($this->supported_symbol, 'HDCUSDT');
}
}
}
......
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