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
e92cd243
Commit
e92cd243
authored
Sep 27, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
6d8ab04c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
+21
-7
Zhaobi.php
common/service/exchange/Zhaobi.php
+21
-7
No files found.
common/service/exchange/Zhaobi.php
View file @
e92cd243
...
...
@@ -14,7 +14,7 @@ class Zhaobi extends Exchange implements ExchangeInterface
{
protected
$supported_symbol
=
'supported_symbol_zhaobi'
;
protected
$quotation_prefix
=
'quotation_zhaobi_'
;
protected
$base_url
=
'https://api.biqianbao.top/api/data/basecoinprice?base=CNY&coin=SFT&platform=zhaobi
'
;
protected
$base_url
=
'https://api.biqianbao.top
'
;
public
function
symbolExists
(
$tag
=
'SFT'
,
$aim
=
"CNY"
)
{
...
...
@@ -33,7 +33,7 @@ class Zhaobi extends Exchange implements ExchangeInterface
*/
public
function
formatSymbol
(
$tag
=
'SFT'
,
$aim
=
'CNY'
)
{
return
strto
upper
(
$tag
.
'_'
.
$aim
);
return
strto
lower
(
trim
(
$tag
)
.
trim
(
$aim
)
);
}
/**
...
...
@@ -54,12 +54,27 @@ class Zhaobi extends Exchange implements ExchangeInterface
public
function
setQuotation
()
{
$curl
=
new
Curl
();
$content
=
$curl
->
get
(
$this
->
base_url
,
false
);
$api
=
$this
->
base_url
.
'/api/data/Ticker?sort=cname'
;
$content
=
$curl
->
get
(
$api
,
false
);
if
(
isset
(
$content
[
'message'
])
&&
'OK'
==
$content
[
'message'
])
{
$ticker_temp
=
[];
foreach
(
$content
[
'data'
]
as
$val
)
{
$ticker_temp
=
array_merge
(
$ticker_temp
,
$val
);
}
foreach
(
$ticker_temp
as
$val
)
{
$key
=
$this
->
quotation_prefix
.
strtolower
(
$val
[
'symbol'
]);
$this
->
redis
->
hmset
(
$key
,
'low'
,
$val
[
'low'
],
'high'
,
$val
[
'high'
],
'last'
,
$val
[
'last'
],
'open'
,
$val
[
'open'
],
'vol'
,
$val
[
'vol'
]);
$this
->
redis
->
sadd
(
$this
->
supported_symbol
,
$val
[
'symbol'
]);
}
}
$api
=
$this
->
base_url
.
'/api/data/basecoinprice?base=CNY&coin=SFT&platform=zhaobi'
;
$content
=
$curl
->
get
(
$api
,
false
);
if
(
is_array
(
$content
)
&&
isset
(
$content
[
'code'
])
&&
(
200
==
$content
[
'code'
]))
{
$data
=
$content
[
'data'
][
0
];
$key
=
$this
->
quotation_prefix
.
'
SFT_CNY
'
;
$key
=
$this
->
quotation_prefix
.
'
sftcny
'
;
$this
->
redis
->
hmset
(
$key
,
'low'
,
$data
[
'value'
],
'high'
,
$data
[
'value'
],
'last'
,
$data
[
'value'
]);
$this
->
redis
->
sadd
(
$this
->
supported_symbol
,
'SFT
_
CNY'
);
$this
->
redis
->
sadd
(
$this
->
supported_symbol
,
'SFTCNY'
);
}
}
}
\ No newline at end of file
}
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