Commit 267f9caf authored by shajiaiming's avatar shajiaiming

fix

parent e631e21e
...@@ -61,14 +61,14 @@ class HuobiBuilder extends FactoryService ...@@ -61,14 +61,14 @@ class HuobiBuilder extends FactoryService
$ticker = []; $ticker = [];
$this->code = 0; $this->code = 0;
foreach ($symbol as $key => $val) { foreach ($symbol as $key => $val) {
$url = $api . '/?symbol=' . $val; $url = $api . '?symbol=' . $val;
$res = $curl->get($url, false); $res = $curl->get($url, false);
if (isset($res['status']) && 'ok' == $res['status']) { if (isset($res['status']) && 'ok' == $res['status']) {
$explode_arr = explode('usdt', $val); $explode_arr = explode('usdt', $val);
$temp = []; $temp = [];
$temp['symbol'] = strtoupper($explode_arr[0]) . '/' . strtoupper($explode_arr[1]); $temp['symbol'] = strtoupper($explode_arr[0]) . '/USDT';
$temp['currency'] = strtoupper($explode_arr[0]); $temp['currency'] = strtoupper($explode_arr[0]);
$temp['base_currency'] = strtoupper($explode_arr[0]); $temp['base_currency'] = '/USDT';
$temp['close'] = (float)sprintf("%0.6f", $res['tick']['close']); $temp['close'] = (float)sprintf("%0.6f", $res['tick']['close']);
$temp['close_usd'] = (float)sprintf("%0.6f", $res['tick']['close'] * $this->basic_price['USDT']['usd']); $temp['close_usd'] = (float)sprintf("%0.6f", $res['tick']['close'] * $this->basic_price['USDT']['usd']);
$temp['close_rmb'] = (float)sprintf("%0.4f", $res['tick']['close'] * $this->basic_price['USDT']['rmb']); $temp['close_rmb'] = (float)sprintf("%0.4f", $res['tick']['close'] * $this->basic_price['USDT']['rmb']);
......
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