Commit 1b095a0f authored by shajiaming's avatar shajiaming

Merge branch 'feature/optimize' into develop

parents 99c5b3db f616f51e
...@@ -36,7 +36,7 @@ class MarketController extends BaseController ...@@ -36,7 +36,7 @@ class MarketController extends BaseController
public function actionExchange() public function actionExchange()
{ {
$exchanges = Yii::$app->params['exchange']; $exchanges = array_unique(Yii::$app->params['exchange']);
return ['code' => $this->code, 'msg' => $this->msg, 'data' => $exchanges]; return ['code' => $this->code, 'msg' => $this->msg, 'data' => $exchanges];
} }
......
...@@ -187,7 +187,7 @@ class ExchangeBusiness ...@@ -187,7 +187,7 @@ class ExchangeBusiness
if (in_array(strtoupper($tag), ['SFT'])) { if (in_array(strtoupper($tag), ['SFT'])) {
$exchange = ExchangeFactory::createExchange("Zhaobi"); $exchange = ExchangeFactory::createExchange("Zhaobi");
$quotation = $exchange->getTicker($tag, 'CNY'); $quotation = $exchange->getTicker($tag, 'USDT');
$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']);
...@@ -329,7 +329,7 @@ class ExchangeBusiness ...@@ -329,7 +329,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'])) { if (in_array(strtoupper($tag), ['FOLI', 'CIC', 'KPC8', 'BVA', 'DAG', 'BNC', 'GHP', 'DRA', 'ETC', 'PAX', 'STH', 'XJH', 'SFT'])) {
$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);
} else if (in_array(strtoupper($tag), ['SUSD'])) { } else if (in_array(strtoupper($tag), ['SUSD'])) {
......
...@@ -103,9 +103,6 @@ class OrderController extends Controller ...@@ -103,9 +103,6 @@ class OrderController extends Controller
// 'host' => '172.16.100.77', // 'host' => '172.16.100.77',
// 'port' => 8801 // 'port' => 8801
// ]; // ];
$service = new Chain33Service($node_params);
$result = $service->getHeight();
$consensHeight = $result['result']['consensHeight'];
$current_time = time(); $current_time = time();
foreach ($model as $val) { foreach ($model as $val) {
...@@ -163,8 +160,13 @@ class OrderController extends Controller ...@@ -163,8 +160,13 @@ class OrderController extends Controller
doEnd : doEnd :
//3步交易情况下需要做高度判断,2步交易注释IF判断 //3步交易情况下需要做高度判断,2步交易注释IF判断
if (CoinCTocTransfer::CONSENSUE_YES == $val['consensus'] && true == $switch && isset($height) && ($consensHeight < $height)) { if (CoinCTocTransfer::CONSENSUE_YES == $val['consensus'] && true == $switch && isset($height)) {
continue; $service = new Chain33Service($node_params);
$result = $service->getHeight();
$consensHeight = $result['result']['consensHeight'];
if ($consensHeight < $height) {
continue;
}
} }
$currentModel = CoinCTocTransfer::findOne($val['id']); $currentModel = CoinCTocTransfer::findOne($val['id']);
$currentModel->query_result = $query_result; $currentModel->query_result = $query_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