Commit a946a704 authored by shajiaiming's avatar shajiaiming

optimize

parent e5a57ee8
......@@ -150,6 +150,13 @@ class ExchangeBusiness
goto doEnd;
}
if (in_array(strtoupper($tag), ['SUSD'])) {
$exchange = ExchangeFactory::createExchange("Go");
$quotation = $exchange->getTicker('CNY', 'USD');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']);
goto doEnd;
}
if (in_array(strtoupper($tag), ['SJPY'])) {
$exchange = ExchangeFactory::createExchange("Boc");
$quotation = $exchange->getTicker('CNY', 'JPY');
......@@ -222,6 +229,8 @@ class ExchangeBusiness
if (in_array(strtoupper($tag), ['FOLI'])) {
$quotation['usd'] = (float)sprintf("%0.4f", $quotation['last']);
$quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last'] / $cny_usd_rate);
} else if (in_array(strtoupper($tag), ['SUSD'])) {
$quotation['usd'] = (float)sprintf("%0.4f", 1);
} else {
$quotation['usd'] = (float)sprintf("%0.4f", $quotation['rmb'] * $cny_usd_rate);
}
......
......@@ -62,6 +62,13 @@ class CoinController extends BaseController
$names = [$names];
}
$condition = $names;
$platform = Yii::$app->request->POST('platform', '');
if (!empty($platform)) {
$condition = [];
foreach ($names as $val) {
$condition[] = [$val, $platform];
}
}
$fields = ['id', 'sid', 'icon', 'name', 'nickname', 'platform', 'chain', 'address as contract_address', 'introduce'];
$result = ExchangeBusiness::getApiListForIndex(1, 999, $condition, $fields);
if ($result) {
......
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