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
8b96e71c
Commit
8b96e71c
authored
Nov 04, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
61632c83
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
HuobiBuilder.php
common/service/exchange/factory/HuobiBuilder.php
+3
-2
TickerController.php
console/controllers/TickerController.php
+1
-1
No files found.
common/service/exchange/factory/HuobiBuilder.php
View file @
8b96e71c
...
@@ -118,6 +118,7 @@ class HuobiBuilder extends FactoryService
...
@@ -118,6 +118,7 @@ class HuobiBuilder extends FactoryService
$temp
[
'close'
]
=
number_format
(
$close
,
6
,
'.'
,
''
);
$temp
[
'close'
]
=
number_format
(
$close
,
6
,
'.'
,
''
);
$temp
[
'low'
]
=
$low
;
$temp
[
'low'
]
=
$low
;
$temp
[
'high'
]
=
$high
;
$temp
[
'high'
]
=
$high
;
$temp
[
'open'
]
=
$open
;
$temp
[
'vol'
]
=
$vol
;
$temp
[
'vol'
]
=
$vol
;
$temp
[
'change'
]
=
(
0
==
$open
)
?
0
:
(
float
)
sprintf
(
"%0.2f"
,
(
$close
-
$open
)
/
$open
*
100
);
$temp
[
'change'
]
=
(
0
==
$open
)
?
0
:
(
float
)
sprintf
(
"%0.2f"
,
(
$close
-
$open
)
/
$open
*
100
);
array_push
(
$ticker
,
$temp
);
array_push
(
$ticker
,
$temp
);
...
@@ -128,7 +129,7 @@ class HuobiBuilder extends FactoryService
...
@@ -128,7 +129,7 @@ class HuobiBuilder extends FactoryService
$this
->
redis_ticker
->
hmset
(
$key
,
'low'
,
$val
[
'low'
],
'high'
,
$val
[
'high'
],
'last'
,
$val
[
'close'
],
'open'
,
$val
[
'open'
],
'vol'
,
$val
[
'vol'
]);
$this
->
redis_ticker
->
hmset
(
$key
,
'low'
,
$val
[
'low'
],
'high'
,
$val
[
'high'
],
'last'
,
$val
[
'close'
],
'open'
,
$val
[
'open'
],
'vol'
,
$val
[
'vol'
]);
$this
->
redis_ticker
->
sadd
(
$this
->
supported_symbol
,
$val
[
'symbol'
]);
$this
->
redis_ticker
->
sadd
(
$this
->
supported_symbol
,
$val
[
'symbol'
]);
$this
->
redis_ticker
->
lpush
(
$this
->
supported_symbol_
list
,
$val
);
$this
->
redis_ticker
->
lpush
(
$this
->
supported_symbol_
close_sort
,
strtoupper
(
$val
[
'symbol'
])
);
}
}
$ticker_change_close
=
$this
->
arraySort
(
$ticker
,
'change'
);
$ticker_change_close
=
$this
->
arraySort
(
$ticker
,
'change'
);
foreach
(
$ticker_change_close
as
$val
)
{
foreach
(
$ticker_change_close
as
$val
)
{
...
@@ -136,7 +137,7 @@ class HuobiBuilder extends FactoryService
...
@@ -136,7 +137,7 @@ class HuobiBuilder extends FactoryService
$this
->
redis_ticker
->
hmset
(
$key
,
'low'
,
$val
[
'low'
],
'high'
,
$val
[
'high'
],
'last'
,
$val
[
'close'
],
'open'
,
$val
[
'open'
],
'vol'
,
$val
[
'vol'
]);
$this
->
redis_ticker
->
hmset
(
$key
,
'low'
,
$val
[
'low'
],
'high'
,
$val
[
'high'
],
'last'
,
$val
[
'close'
],
'open'
,
$val
[
'open'
],
'vol'
,
$val
[
'vol'
]);
$this
->
redis_ticker
->
sadd
(
$this
->
supported_symbol
,
$val
[
'symbol'
]);
$this
->
redis_ticker
->
sadd
(
$this
->
supported_symbol
,
$val
[
'symbol'
]);
$this
->
redis_ticker
->
lpush
(
$this
->
supported_symbol_
list
,
$val
);
$this
->
redis_ticker
->
lpush
(
$this
->
supported_symbol_
change_sort
,
strtoupper
(
$val
[
'symbol'
])
);
}
}
}
}
...
...
console/controllers/TickerController.php
View file @
8b96e71c
...
@@ -14,7 +14,7 @@ class TickerController extends Controller
...
@@ -14,7 +14,7 @@ class TickerController extends Controller
{
{
public
function
actionSort
()
public
function
actionSort
()
{
{
$class
=
[
'
Binance'
,
'Huobi'
,
'Zha
obi'
];
$class
=
[
'
Hu
obi'
];
foreach
(
$class
as
$val
)
{
foreach
(
$class
as
$val
)
{
go
(
function
()
use
(
$val
)
{
go
(
function
()
use
(
$val
)
{
\Co
::
sleep
(
0.5
);
\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