Commit 4138af04 authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/ticker' into 'master'

new ticker See merge request !400
parents ec517a6e f3581a73
...@@ -175,6 +175,12 @@ class ExchangeBusiness ...@@ -175,6 +175,12 @@ class ExchangeBusiness
} }
$f = false; $f = false;
$quotation = []; $quotation = [];
if (in_array(strtoupper($tag), ['GLCW'])) {
$exchange = ExchangeFactory::createExchange("Jinwang");
$quotation = $exchange->getTicker($tag, 'USDT');
goto doEnd;
}
if (in_array(strtoupper($tag), ['SUM', 'USDW', 'FUT'])) { if (in_array(strtoupper($tag), ['SUM', 'USDW', 'FUT'])) {
$exchange = ExchangeFactory::createExchange("Isummit"); $exchange = ExchangeFactory::createExchange("Isummit");
$quotation = $exchange->getTicker($tag, 'USDT'); $quotation = $exchange->getTicker($tag, 'USDT');
...@@ -390,7 +396,7 @@ class ExchangeBusiness ...@@ -390,7 +396,7 @@ class ExchangeBusiness
$exchange = ExchangeFactory::createExchange("Go"); $exchange = ExchangeFactory::createExchange("Go");
$rate = $exchange->getTicker("CNY", "USD"); $rate = $exchange->getTicker("CNY", "USD");
$cny_usd_rate = 1 / $rate['last']; $cny_usd_rate = 1 / $rate['last'];
if (in_array(strtoupper($tag), ['FOLI', 'CIC', 'KPC8', 'BVA', 'DAG', 'BNC', 'GHP', 'DRA', 'ETC', 'PAX', 'STH', 'XJH', 'SFT', 'TSC', 'SUM', 'USDW', 'FUT', 'MBTC', 'METH'])) { if (in_array(strtoupper($tag), ['FOLI', 'CIC', 'KPC8', 'BVA', 'DAG', 'BNC', 'GHP', 'DRA', 'ETC', 'PAX', 'STH', 'XJH', 'SFT', 'TSC', 'SUM', 'USDW', 'FUT', 'MBTC', 'METH', 'GLCW'])) {
$quotation['usd'] = (float)sprintf("%0.4f", $quotation['last']); $quotation['usd'] = (float)sprintf("%0.4f", $quotation['last']);
$quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last'] / $cny_usd_rate); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last'] / $cny_usd_rate);
$quotation['low'] = (float)sprintf("%0.4f", $quotation['low']); $quotation['low'] = (float)sprintf("%0.4f", $quotation['low']);
......
...@@ -34,7 +34,7 @@ class Jinwang extends Exchange implements ExchangeInterface ...@@ -34,7 +34,7 @@ class Jinwang extends Exchange implements ExchangeInterface
*/ */
public function formatSymbol($tag = 'TG', $aim = 'USDT') public function formatSymbol($tag = 'TG', $aim = 'USDT')
{ {
return strtoupper($tag . $aim); return strtolower($tag . '_' . $aim);
} }
/** /**
......
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