Commit 9358c32a authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/ticker' into 'master'

价格显示 See merge request !235
parents e5e59f1b 67da7bee
...@@ -119,42 +119,42 @@ class ExchangeBusiness ...@@ -119,42 +119,42 @@ class ExchangeBusiness
if (in_array(strtoupper($tag), ['FOLI'])) { if (in_array(strtoupper($tag), ['FOLI'])) {
$exchange = ExchangeFactory::createExchange("Ex"); $exchange = ExchangeFactory::createExchange("Ex");
$quotation = $exchange->getTicker($tag, 'USDT'); $quotation = $exchange->getTicker($tag, 'USDT');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last']);
goto doEnd; goto doEnd;
} }
if (in_array(strtoupper($tag), ['DAG'])) { if (in_array(strtoupper($tag), ['DAG'])) {
$exchange = ExchangeFactory::createExchange("Dag"); $exchange = ExchangeFactory::createExchange("Dag");
$quotation = $exchange->getTicker($tag, 'USDT'); $quotation = $exchange->getTicker($tag, 'USDT');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last']);
goto doEnd; goto doEnd;
} }
if (in_array(strtoupper($tag), ['BNC'])) { if (in_array(strtoupper($tag), ['BNC'])) {
$exchange = ExchangeFactory::createExchange("Bitnasdaq"); $exchange = ExchangeFactory::createExchange("Bitnasdaq");
$quotation = $exchange->getTicker($tag, 'USDT'); $quotation = $exchange->getTicker($tag, 'USDT');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last']);
goto doEnd; goto doEnd;
} }
if (in_array(strtoupper($tag), ['GM', 'BSTC'])) { if (in_array(strtoupper($tag), ['GM', 'BSTC'])) {
$exchange = ExchangeFactory::createExchange("Token7"); $exchange = ExchangeFactory::createExchange("Token7");
$quotation = $exchange->getTicker($tag, 'HA'); $quotation = $exchange->getTicker($tag, 'HA');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last']);
goto doEnd; goto doEnd;
} }
if (in_array(strtoupper($tag), ['BECC'])) { if (in_array(strtoupper($tag), ['BECC'])) {
$exchange = ExchangeFactory::createExchange("S"); $exchange = ExchangeFactory::createExchange("S");
$quotation = $exchange->getTicker($tag, 'ST'); $quotation = $exchange->getTicker($tag, 'ST');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last']);
goto doEnd; goto doEnd;
} }
if (in_array(strtoupper($tag), ['GHP'])) { if (in_array(strtoupper($tag), ['GHP'])) {
$exchange = ExchangeFactory::createExchange("Bitnasdaq"); $exchange = ExchangeFactory::createExchange("Bitnasdaq");
$quotation = $exchange->getTicker($tag); $quotation = $exchange->getTicker($tag);
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last']);
goto doEnd; goto doEnd;
} }
...@@ -164,28 +164,28 @@ class ExchangeBusiness ...@@ -164,28 +164,28 @@ class ExchangeBusiness
$quotation['low'] = (float)sprintf("%0.4f", $quotation['low']); $quotation['low'] = (float)sprintf("%0.4f", $quotation['low']);
$quotation['high'] = (float)sprintf("%0.4f", $quotation['high']); $quotation['high'] = (float)sprintf("%0.4f", $quotation['high']);
$quotation['last'] = (float)sprintf("%0.4f", $quotation['last']); $quotation['last'] = (float)sprintf("%0.4f", $quotation['last']);
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last']);
goto doEnd; goto doEnd;
} }
if (in_array(strtoupper($tag), ['CTG'])) { if (in_array(strtoupper($tag), ['CTG'])) {
$exchange = ExchangeFactory::createExchange("Gdpro"); $exchange = ExchangeFactory::createExchange("Gdpro");
$quotation = $exchange->getTicker($tag, 'CNY'); $quotation = $exchange->getTicker($tag, 'CNY');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last']);
goto doEnd; goto doEnd;
} }
if (in_array(strtoupper($tag), ['USDT'])) { if (in_array(strtoupper($tag), ['USDT'])) {
$exchange = ExchangeFactory::createExchange("Go"); $exchange = ExchangeFactory::createExchange("Go");
$quotation = $exchange->getTicker('CNY', 'USD'); $quotation = $exchange->getTicker('CNY', 'USD');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last']);
goto doEnd; goto doEnd;
} }
if (in_array(strtoupper($tag), ['SUSD'])) { if (in_array(strtoupper($tag), ['SUSD'])) {
$exchange = ExchangeFactory::createExchange("Go"); $exchange = ExchangeFactory::createExchange("Go");
$quotation = $exchange->getTicker('CNY', 'USD'); $quotation = $exchange->getTicker('CNY', 'USD');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last']);
goto doEnd; goto doEnd;
} }
...@@ -198,7 +198,7 @@ class ExchangeBusiness ...@@ -198,7 +198,7 @@ class ExchangeBusiness
if (in_array(strtoupper($tag), ['TSC'])) { if (in_array(strtoupper($tag), ['TSC'])) {
$exchange = ExchangeFactory::createExchange("Tsc"); $exchange = ExchangeFactory::createExchange("Tsc");
$quotation = $exchange->getTicker('TSC', 'CNDT'); $quotation = $exchange->getTicker('TSC', 'CNDT');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last']);
goto doEnd; goto doEnd;
} }
......
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