Commit 65be4ec7 authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/optimize' into develop

parents a1f66b92 20928230
...@@ -378,7 +378,7 @@ class TickerController extends BaseController ...@@ -378,7 +378,7 @@ class TickerController extends BaseController
], [ ], [
'exchange' => 'hd', 'exchange' => 'hd',
'symbol' => [ 'symbol' => [
'hdusdt' 'hdcusdt'
], ],
] ]
]; ];
......
...@@ -144,10 +144,10 @@ class ExchangeBusiness ...@@ -144,10 +144,10 @@ class ExchangeBusiness
if (strtoupper($tag) == 'POKE') { if (strtoupper($tag) == 'POKE') {
$quotation = [ $quotation = [
'low' => 0.1611, 'low' => 0.1617,
'high' => 0.1611, 'high' => 0.1617,
'last' => 0.1611, 'last' => 0.1617,
'rmb' => 0.1611, 'rmb' => 0.1617,
]; ];
goto doEnd; goto doEnd;
} }
...@@ -162,7 +162,7 @@ class ExchangeBusiness ...@@ -162,7 +162,7 @@ class ExchangeBusiness
goto doEnd; goto doEnd;
} }
if (strtoupper($tag) == 'GST' || strtoupper($tag) == 'JNTK' || strtoupper($tag) == 'SPT' || strtoupper($tag) == 'STO' || strtoupper($tag) == 'GM' || strtoupper($tag) == 'BSTC' || strtoupper($tag) == 'RYH' || strtoupper($tag) == 'CNDT' || strtoupper($tag) == 'WL' || strtoupper($tag) == 'ETS' || strtoupper($tag) == 'LIMS' || strtoupper($tag) == 'AT' || strtoupper($tag) == 'BTJ') { if (in_array(strtoupper($tag), ['GST', 'JNTK', 'SPT', 'STO', 'GM', 'BSTC', 'RYH', 'CNDT', 'WL', 'ETS', 'LIMS', 'AT', 'BTJ', 'WXB'])) {
$quotation = [ $quotation = [
'low' => 0, 'low' => 0,
'high' => 0, 'high' => 0,
...@@ -312,6 +312,26 @@ class ExchangeBusiness ...@@ -312,6 +312,26 @@ class ExchangeBusiness
goto doEnd; goto doEnd;
} }
if (in_array(strtoupper($tag), ['LFT'])) {
$quotation = [
'low' => 100,
'high' => 100,
'last' => 100,
'rmb' => 100,
];
goto doEnd;
}
if (in_array(strtoupper($tag), ['ONE'])) {
$quotation = [
'low' => 328,
'high' => 328,
'last' => 328,
'rmb' => 328,
];
goto doEnd;
}
if (in_array(strtoupper($tag), ['BVA'])) { if (in_array(strtoupper($tag), ['BVA'])) {
$exchange = ExchangeFactory::createExchange("Bilaxy"); $exchange = ExchangeFactory::createExchange("Bilaxy");
$quotation = $exchange->getTicker('BVA', 'USDT'); $quotation = $exchange->getTicker('BVA', 'USDT');
...@@ -343,7 +363,7 @@ class ExchangeBusiness ...@@ -343,7 +363,7 @@ class ExchangeBusiness
if (in_array(strtoupper($tag), ['HDC'])) { if (in_array(strtoupper($tag), ['HDC'])) {
$exchange = ExchangeFactory::createExchange("Hd"); $exchange = ExchangeFactory::createExchange("Hd");
$quotation = $exchange->getTicker('HD', 'USDT'); $quotation = $exchange->getTicker('HDC', 'USDT');
goto doEnd; goto doEnd;
} }
......
...@@ -16,7 +16,7 @@ class Hd extends Exchange implements ExchangeInterface ...@@ -16,7 +16,7 @@ class Hd extends Exchange implements ExchangeInterface
protected $quotation_prefix = 'quotation_hd_'; protected $quotation_prefix = 'quotation_hd_';
protected $base_url = 'https://app.honordecent.com/exchange/getHdcCurrPrice'; protected $base_url = 'https://app.honordecent.com/exchange/getHdcCurrPrice';
public function symbolExists($tag = 'HD', $aim = "USDT") public function symbolExists($tag = 'HDC', $aim = "USDT")
{ {
$supported = $this->redis->smembers($this->supported_symbol); $supported = $this->redis->smembers($this->supported_symbol);
if (is_array($supported) && in_array($this->formatSymbol($tag, $aim), $supported)) { if (is_array($supported) && in_array($this->formatSymbol($tag, $aim), $supported)) {
...@@ -32,7 +32,7 @@ class Hd extends Exchange implements ExchangeInterface ...@@ -32,7 +32,7 @@ class Hd extends Exchange implements ExchangeInterface
* @param string $aim * @param string $aim
* @return mixed * @return mixed
*/ */
public function formatSymbol($tag = 'HD', $aim = 'USDT') public function formatSymbol($tag = 'HDC', $aim = 'USDT')
{ {
return strtoupper($tag . $aim); return strtoupper($tag . $aim);
} }
...@@ -57,10 +57,10 @@ class Hd extends Exchange implements ExchangeInterface ...@@ -57,10 +57,10 @@ class Hd extends Exchange implements ExchangeInterface
$curl = new Curl(); $curl = new Curl();
$res = $curl->get($this->base_url, false); $res = $curl->get($this->base_url, false);
if (is_array($res) && 1 == $res['code']) { if (is_array($res) && 1 == $res['code']) {
$key = $this->quotation_prefix . 'HDUSDT'; $key = $this->quotation_prefix . 'HDCUSDT';
$this->redis->hmset($key, 'low', $res['data'], 'high', $res['data'], 'last', $res['data']); $this->redis->hmset($key, 'low', $res['data'], 'high', $res['data'], 'last', $res['data']);
if (!$this->redis->sismember($this->supported_symbol, 'HDUSDT')) { if (!$this->redis->sismember($this->supported_symbol, 'HDCUSDT')) {
$this->redis->sadd($this->supported_symbol, 'HDUSDT'); $this->redis->sadd($this->supported_symbol, 'HDCUSDT');
} }
} }
} }
......
...@@ -28,7 +28,7 @@ class AssetController extends BaseController ...@@ -28,7 +28,7 @@ class AssetController extends BaseController
$uri = Yii::$app->request->post('uri', ''); $uri = Yii::$app->request->post('uri', '');
$method = Yii::$app->request->post('method', 'GET'); $method = Yii::$app->request->post('method', 'GET');
$params = Yii::$app->request->post('params', ''); $params = Yii::$app->request->post('params', ['page' => 1, 'size' => 10]);
$time = time(); $time = time();
$appKey = isset($node_params['appKey']) ? $node_params['appKey'] : null; $appKey = isset($node_params['appKey']) ? $node_params['appKey'] : null;
......
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