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
646e732c
Commit
646e732c
authored
Nov 14, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
b0d6b746
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
4 deletions
+22
-4
BinanceBuilder.php
common/service/exchange/factory/BinanceBuilder.php
+7
-1
HuobiBuilder.php
common/service/exchange/factory/HuobiBuilder.php
+7
-1
ZhaobiBuilder.php
common/service/exchange/factory/ZhaobiBuilder.php
+7
-1
TickerController.php
console/controllers/TickerController.php
+1
-1
No files found.
common/service/exchange/factory/BinanceBuilder.php
View file @
646e732c
...
...
@@ -114,6 +114,12 @@ class BinanceBuilder extends FactoryService
$temp
=
[];
$temp
[
'symbol'
]
=
strtoupper
(
$symbol
);
$temp
[
'close'
]
=
$close
;
foreach
(
$this
->
basic_coin
as
$k
=>
$coin
)
{
$explode_arr
=
explode
(
strtoupper
(
$coin
),
strtoupper
(
$symbol
));
if
(
2
==
count
(
$explode_arr
)
&&
empty
(
$explode_arr
[
1
]))
{
$temp
[
'close_rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$close
*
$this
->
basic_price
[
$coin
][
'rmb'
]);
}
}
$temp
[
'low'
]
=
$low
;
$temp
[
'high'
]
=
$high
;
$temp
[
'open'
]
=
$open
;
...
...
@@ -124,7 +130,7 @@ class BinanceBuilder extends FactoryService
$this
->
redis_ticker
->
hmset
(
$key
,
'low'
,
$low
,
'high'
,
$high
,
'last'
,
$close
,
'open'
,
$open
,
'vol'
,
$vol
);
}
$ticker_sort_close
=
Tools
::
arraySort
(
$ticker
,
'close'
);
$ticker_sort_close
=
Tools
::
arraySort
(
$ticker
,
'close
_rmb
'
);
$this
->
redis_ticker
->
del
(
$this
->
supported_symbol_close_asc
);
$this
->
redis_ticker
->
del
(
$this
->
supported_symbol_close_desc
);
foreach
(
$ticker_sort_close
as
$val
)
{
...
...
common/service/exchange/factory/HuobiBuilder.php
View file @
646e732c
...
...
@@ -135,6 +135,12 @@ class HuobiBuilder extends FactoryService
$temp
=
[];
$temp
[
'symbol'
]
=
strtoupper
(
$symbol
);
$temp
[
'close'
]
=
$close
;
foreach
(
$this
->
basic_coin
as
$k
=>
$coin
)
{
$explode_arr
=
explode
(
strtoupper
(
$coin
),
strtoupper
(
$symbol
));
if
(
2
==
count
(
$explode_arr
)
&&
empty
(
$explode_arr
[
1
]))
{
$temp
[
'close_rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$close
*
$this
->
basic_price
[
$coin
][
'rmb'
]);
}
}
$temp
[
'low'
]
=
$low
;
$temp
[
'high'
]
=
$high
;
$temp
[
'open'
]
=
$open
;
...
...
@@ -145,7 +151,7 @@ class HuobiBuilder extends FactoryService
$this
->
redis_ticker
->
hmset
(
$key
,
'low'
,
$low
,
'high'
,
$high
,
'last'
,
$close
,
'open'
,
$open
,
'vol'
,
$vol
);
}
$ticker_sort_close
=
Tools
::
arraySort
(
$ticker
,
'close'
);
$ticker_sort_close
=
Tools
::
arraySort
(
$ticker
,
'close
_rmb
'
);
$this
->
redis_ticker
->
del
(
$this
->
supported_symbol_close_asc
);
$this
->
redis_ticker
->
del
(
$this
->
supported_symbol_close_desc
);
foreach
(
$ticker_sort_close
as
$val
)
{
...
...
common/service/exchange/factory/ZhaobiBuilder.php
View file @
646e732c
...
...
@@ -103,13 +103,19 @@ class ZhaobiBuilder extends FactoryService
$temp
=
[];
$temp
[
'symbol'
]
=
strtoupper
(
$symbol
);
$temp
[
'close'
]
=
number_format
(
$close
,
6
,
'.'
,
''
);
foreach
(
$this
->
basic_coin
as
$k
=>
$coin
)
{
$explode_arr
=
explode
(
strtoupper
(
$coin
),
strtoupper
(
$symbol
));
if
(
2
==
count
(
$explode_arr
)
&&
empty
(
$explode_arr
[
1
]))
{
$temp
[
'close_rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$close
*
$this
->
basic_price
[
$coin
][
'rmb'
]);
}
}
$temp
[
'change'
]
=
(
0
==
$open
)
?
0
:
(
float
)
sprintf
(
"%0.2f"
,
(
$close
-
$open
)
/
$open
*
100
);
array_push
(
$ticker
,
$temp
);
$key
=
$this
->
quotation_prefix
.
strtoupper
(
$symbol
);
$this
->
redis_ticker
->
hmset
(
$key
,
'low'
,
$low
,
'high'
,
$high
,
'last'
,
$close
,
'open'
,
$open
,
'vol'
,
$vol
);
}
$ticker_sort_close
=
Tools
::
arraySort
(
$ticker
,
'close'
);
$ticker_sort_close
=
Tools
::
arraySort
(
$ticker
,
'close
_rmb
'
);
$this
->
redis_ticker
->
del
(
$this
->
supported_symbol_close_asc
);
$this
->
redis_ticker
->
del
(
$this
->
supported_symbol_close_desc
);
foreach
(
$ticker_sort_close
as
$val
)
{
...
...
console/controllers/TickerController.php
View file @
646e732c
...
...
@@ -14,7 +14,7 @@ class TickerController extends Controller
{
public
function
actionSort
()
{
$class
=
[
'
Binance'
,
'Huobi'
,
'Zha
obi'
];
$class
=
[
'
Hu
obi'
];
foreach
(
$class
as
$val
)
{
go
(
function
()
use
(
$val
)
{
\Co
::
sleep
(
0.5
);
...
...
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