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
04100c0a
Commit
04100c0a
authored
Nov 13, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/ticker' into 'master'
fix See merge request
!413
parents
cd40ebed
8627d6db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
Ztb.php
common/service/exchange/Ztb.php
+7
-5
No files found.
common/service/exchange/Ztb.php
View file @
04100c0a
...
...
@@ -14,7 +14,7 @@ class Ztb extends Exchange implements ExchangeInterface
{
protected
$supported_symbol
=
'supported_symbol_ztb'
;
protected
$quotation_prefix
=
'quotation_ztb_'
;
protected
$base_url
=
'https://www.ztb.com/api/v1/tickers'
;
protected
$base_url
=
'https://www.ztb.com/api/v1/tickers'
;
public
function
symbolExists
(
$tag
=
'ZYC'
,
$aim
=
"USDT"
)
...
...
@@ -25,6 +25,7 @@ class Ztb extends Exchange implements ExchangeInterface
}
return
false
;
}
/**
* 转化交易对为请求变量
*
...
...
@@ -55,15 +56,16 @@ class Ztb extends Exchange implements ExchangeInterface
public
function
setQuotation
()
{
$curl
=
new
Curl
();
$content
=
$curl
->
get
(
$this
->
base_url
,
false
);
$content
=
$curl
->
get
(
$this
->
base_url
,
true
);
$content
=
json_decode
(
$content
,
true
);
if
(
is_array
(
$content
)
&&
isset
(
$content
[
'ticker'
]))
{
$data
=
$content
[
'ticker'
];
foreach
(
$data
as
$item
)
{
if
(
in_array
(
$item
[
'symbol'
],
[
'ZYCUSDT'
]))
{
if
(
in_array
(
$item
[
'symbol'
],
[
'ZYC
_
USDT'
]))
{
$data
=
$item
;
$key
=
$this
->
quotation_prefix
.
$item
[
'symbol'
]
;
$key
=
$this
->
quotation_prefix
.
str_replace
(
'_'
,
''
,
$item
[
'symbol'
])
;
$this
->
redis
->
hmset
(
$key
,
'low'
,
$data
[
'low'
],
'high'
,
$data
[
'high'
],
'last'
,
$data
[
'last'
],
'vol'
,
$data
[
'vol'
],
'change'
,
$data
[
'change'
]);
$this
->
redis
->
sadd
(
$this
->
supported_symbol
,
$item
[
'symbol'
]
);
$this
->
redis
->
sadd
(
$this
->
supported_symbol
,
str_replace
(
'_'
,
''
,
$item
[
'symbol'
])
);
}
}
}
...
...
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