Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wallet
token
Commits
65be4ec7
Commit
65be4ec7
authored
Nov 23, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/optimize' into develop
parents
a1f66b92
20928230
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
13 deletions
+33
-13
TickerController.php
api/controllers/TickerController.php
+1
-1
ExchangeBusiness.php
common/business/ExchangeBusiness.php
+26
-6
Hd.php
common/service/exchange/Hd.php
+5
-5
AssetController.php
wallet/controllers/AssetController.php
+1
-1
No files found.
api/controllers/TickerController.php
View file @
65be4ec7
...
...
@@ -378,7 +378,7 @@ class TickerController extends BaseController
],
[
'exchange'
=>
'hd'
,
'symbol'
=>
[
'hdusdt'
'hd
c
usdt'
],
]
];
...
...
common/business/ExchangeBusiness.php
View file @
65be4ec7
...
...
@@ -144,10 +144,10 @@ class ExchangeBusiness
if
(
strtoupper
(
$tag
)
==
'POKE'
)
{
$quotation
=
[
'low'
=>
0.161
1
,
'high'
=>
0.161
1
,
'last'
=>
0.161
1
,
'rmb'
=>
0.161
1
,
'low'
=>
0.161
7
,
'high'
=>
0.161
7
,
'last'
=>
0.161
7
,
'rmb'
=>
0.161
7
,
];
goto
doEnd
;
}
...
...
@@ -162,7 +162,7 @@ class ExchangeBusiness
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
=
[
'low'
=>
0
,
'high'
=>
0
,
...
...
@@ -312,6 +312,26 @@ class ExchangeBusiness
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'
]))
{
$exchange
=
ExchangeFactory
::
createExchange
(
"Bilaxy"
);
$quotation
=
$exchange
->
getTicker
(
'BVA'
,
'USDT'
);
...
...
@@ -343,7 +363,7 @@ class ExchangeBusiness
if
(
in_array
(
strtoupper
(
$tag
),
[
'HDC'
]))
{
$exchange
=
ExchangeFactory
::
createExchange
(
"Hd"
);
$quotation
=
$exchange
->
getTicker
(
'HD'
,
'USDT'
);
$quotation
=
$exchange
->
getTicker
(
'HD
C
'
,
'USDT'
);
goto
doEnd
;
}
...
...
common/service/exchange/Hd.php
View file @
65be4ec7
...
...
@@ -16,7 +16,7 @@ class Hd extends Exchange implements ExchangeInterface
protected
$quotation_prefix
=
'quotation_hd_'
;
protected
$base_url
=
'https://app.honordecent.com/exchange/getHdcCurrPrice'
;
public
function
symbolExists
(
$tag
=
'HD'
,
$aim
=
"USDT"
)
public
function
symbolExists
(
$tag
=
'HD
C
'
,
$aim
=
"USDT"
)
{
$supported
=
$this
->
redis
->
smembers
(
$this
->
supported_symbol
);
if
(
is_array
(
$supported
)
&&
in_array
(
$this
->
formatSymbol
(
$tag
,
$aim
),
$supported
))
{
...
...
@@ -32,7 +32,7 @@ class Hd extends Exchange implements ExchangeInterface
* @param string $aim
* @return mixed
*/
public
function
formatSymbol
(
$tag
=
'HD'
,
$aim
=
'USDT'
)
public
function
formatSymbol
(
$tag
=
'HD
C
'
,
$aim
=
'USDT'
)
{
return
strtoupper
(
$tag
.
$aim
);
}
...
...
@@ -57,10 +57,10 @@ class Hd extends Exchange implements ExchangeInterface
$curl
=
new
Curl
();
$res
=
$curl
->
get
(
$this
->
base_url
,
false
);
if
(
is_array
(
$res
)
&&
1
==
$res
[
'code'
])
{
$key
=
$this
->
quotation_prefix
.
'HDUSDT'
;
$key
=
$this
->
quotation_prefix
.
'HD
C
USDT'
;
$this
->
redis
->
hmset
(
$key
,
'low'
,
$res
[
'data'
],
'high'
,
$res
[
'data'
],
'last'
,
$res
[
'data'
]);
if
(
!
$this
->
redis
->
sismember
(
$this
->
supported_symbol
,
'HDUSDT'
))
{
$this
->
redis
->
sadd
(
$this
->
supported_symbol
,
'HDUSDT'
);
if
(
!
$this
->
redis
->
sismember
(
$this
->
supported_symbol
,
'HD
C
USDT'
))
{
$this
->
redis
->
sadd
(
$this
->
supported_symbol
,
'HD
C
USDT'
);
}
}
}
...
...
wallet/controllers/AssetController.php
View file @
65be4ec7
...
...
@@ -28,7 +28,7 @@ class AssetController extends BaseController
$uri
=
Yii
::
$app
->
request
->
post
(
'uri'
,
''
);
$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
();
$appKey
=
isset
(
$node_params
[
'appKey'
])
?
$node_params
[
'appKey'
]
:
null
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment