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
70b608e5
Commit
70b608e5
authored
Nov 16, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feature/optimize
parents
2037b9d8
a4508f34
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
TickerController.php
api/controllers/TickerController.php
+1
-1
Hd.php
common/service/exchange/Hd.php
+5
-5
No files found.
api/controllers/TickerController.php
View file @
70b608e5
...
...
@@ -378,7 +378,7 @@ class TickerController extends BaseController
],
[
'exchange'
=>
'hd'
,
'symbol'
=>
[
'hdusdt'
'hd
c
usdt'
],
]
];
...
...
common/service/exchange/Hd.php
View file @
70b608e5
...
...
@@ -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'
);
}
}
}
...
...
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