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
d8c5ea90
Commit
d8c5ea90
authored
Sep 15, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/ticker' into 'master'
fix See merge request
!390
parents
322e8854
3e2fca9d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
Bitnasdaq.php
common/service/exchange/Bitnasdaq.php
+1
-1
BitnasdaqBuilder.php
common/service/exchange/factory/BitnasdaqBuilder.php
+2
-2
No files found.
common/service/exchange/Bitnasdaq.php
View file @
d8c5ea90
...
...
@@ -36,7 +36,7 @@ class Bitnasdaq extends Exchange implements ExchangeInterface
if
(
is_array
(
$res
)
&&
isset
(
$res
[
'data'
]))
{
$data
=
$res
[
'data'
][
'ticker'
];
foreach
(
$data
as
$key
=>
$item
)
{
if
(
in_array
(
strtoupper
(
$item
[
'symbol'
]),
[
'BNCUSAT'
,
'BTCUSAT'
,
'ETCUSAT'
,
'ETHUSAT'
,
'GHPUSAT'
,
'LTCUSAT'
]))
{
if
(
in_array
(
strtoupper
(
$item
[
'symbol'
]),
[
'BNCUSAT'
,
'BTCUSAT'
,
'ETCUSAT'
,
'ETHUSAT'
,
'GHPUSAT'
,
'LTCUSAT'
,
'BNCUSDT'
]))
{
$low
=
isset
(
$item
[
'low'
])
?
$item
[
'low'
]
:
0
;
$high
=
isset
(
$item
[
'high'
])
?
$item
[
'high'
]
:
0
;
$last
=
isset
(
$item
[
'last'
])
?
$item
[
'last'
]
:
0
;
...
...
common/service/exchange/factory/BitnasdaqBuilder.php
View file @
d8c5ea90
...
...
@@ -154,7 +154,7 @@ class BitnasdaqBuilder extends FactoryService
$ticker
=
[];
foreach
(
$symbol
as
$val
)
{
list
(
$low
,
$high
,
$close
,
$open
,
$
vol
)
=
$this
->
redis
->
hmget
(
$this
->
quotation_prefix
.
strtolower
(
$val
),
'low'
,
'high'
,
'last'
,
'open
'
,
'vol'
);
list
(
$low
,
$high
,
$close
,
$open
,
$
change
,
$vol
)
=
$this
->
redis
->
hmget
(
$this
->
quotation_prefix
.
strtolower
(
$val
),
'low'
,
'high'
,
'last'
,
'open'
,
'change
'
,
'vol'
);
$explode_arr
=
explode
(
'usdt'
,
$val
);
$temp
=
[];
$temp
[
'symbol'
]
=
strtoupper
(
$explode_arr
[
0
])
.
'/USDT'
;
...
...
@@ -163,7 +163,7 @@ class BitnasdaqBuilder extends FactoryService
$temp
[
'close'
]
=
(
float
)
sprintf
(
"%0.6f"
,
$close
);
$temp
[
'close_usd'
]
=
(
float
)
sprintf
(
"%0.6f"
,
$close
*
$this
->
basic_price
[
'USDT'
][
'usd'
]);
$temp
[
'close_rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$close
*
$this
->
basic_price
[
'USDT'
][
'rmb'
]);
$temp
[
'change'
]
=
(
0
==
$open
)
?
0
:
(
float
)
sprintf
(
"%0.2f"
,
(
$close
-
$open
)
/
$open
*
100
);
$temp
[
'change'
]
=
(
float
)
sprintf
(
"%0.2f"
,
$change
*
100
);
$temp
[
'high_usd'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$high
*
$this
->
basic_price
[
'USDT'
][
'usd'
]);
$temp
[
'low_usd'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$low
*
$this
->
basic_price
[
'USDT'
][
'usd'
]);
$temp
[
'high_rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$high
*
$this
->
basic_price
[
'USDT'
][
'rmb'
]);
...
...
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