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
0f1a0bb2
Commit
0f1a0bb2
authored
Apr 02, 2022
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ljz ticker
parent
4a818f76
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
ExchangeBusiness.php
common/business/ExchangeBusiness.php
+2
-2
Ljz.php
common/service/exchange/Ljz.php
+10
-10
No files found.
common/business/ExchangeBusiness.php
View file @
0f1a0bb2
...
@@ -209,9 +209,9 @@ class ExchangeBusiness
...
@@ -209,9 +209,9 @@ class ExchangeBusiness
goto
doEnd
;
goto
doEnd
;
}
}
if
(
in_array
(
strtoupper
(
$tag
),
[
'GHT'
]))
{
if
(
in_array
(
strtoupper
(
$tag
),
[
'GHT'
,
'JD'
]))
{
$exchange
=
ExchangeFactory
::
createExchange
(
"Ljz"
);
$exchange
=
ExchangeFactory
::
createExchange
(
"Ljz"
);
$quotation
=
$exchange
->
getTicker
(
$tag
,
'
USDT
'
);
$quotation
=
$exchange
->
getTicker
(
$tag
,
'
CNYD
'
);
$quotation
[
'rmb'
]
=
$quotation
[
'last'
];
$quotation
[
'rmb'
]
=
$quotation
[
'last'
];
goto
doEnd
;
goto
doEnd
;
}
}
...
...
common/service/exchange/Ljz.php
View file @
0f1a0bb2
...
@@ -14,9 +14,9 @@ class Ljz extends Exchange implements ExchangeInterface
...
@@ -14,9 +14,9 @@ class Ljz extends Exchange implements ExchangeInterface
{
{
protected
$supported_symbol
=
'supported_symbol_ljz'
;
protected
$supported_symbol
=
'supported_symbol_ljz'
;
protected
$quotation_prefix
=
'quotation_ljz_'
;
protected
$quotation_prefix
=
'quotation_ljz_'
;
protected
$base_url
=
'http://api.ydqkl.com.cn/market/
exchange-rate/cny/GHT
'
;
protected
$base_url
=
'http://api.ydqkl.com.cn/market/
overview
'
;
public
function
symbolExists
(
$tag
=
'GHT'
,
$aim
=
"
USDT
"
)
public
function
symbolExists
(
$tag
=
'GHT'
,
$aim
=
"
CNYD
"
)
{
{
$supported
=
$this
->
redis
->
smembers
(
$this
->
supported_symbol
);
$supported
=
$this
->
redis
->
smembers
(
$this
->
supported_symbol
);
if
(
is_array
(
$supported
)
&&
in_array
(
$this
->
formatSymbol
(
$tag
,
$aim
),
$supported
))
{
if
(
is_array
(
$supported
)
&&
in_array
(
$this
->
formatSymbol
(
$tag
,
$aim
),
$supported
))
{
...
@@ -32,7 +32,7 @@ class Ljz extends Exchange implements ExchangeInterface
...
@@ -32,7 +32,7 @@ class Ljz extends Exchange implements ExchangeInterface
* @param string $aim
* @param string $aim
* @return mixed
* @return mixed
*/
*/
public
function
formatSymbol
(
$tag
=
'GHT'
,
$aim
=
'
USDT
'
)
public
function
formatSymbol
(
$tag
=
'GHT'
,
$aim
=
'
CNYD
'
)
{
{
return
strtoupper
(
$tag
.
'_'
.
$aim
);
return
strtoupper
(
$tag
.
'_'
.
$aim
);
}
}
...
@@ -56,13 +56,14 @@ class Ljz extends Exchange implements ExchangeInterface
...
@@ -56,13 +56,14 @@ class Ljz extends Exchange implements ExchangeInterface
{
{
$curl
=
new
Curl
();
$curl
=
new
Curl
();
$res
=
$curl
->
get
(
$this
->
base_url
,
false
);
$res
=
$curl
->
get
(
$this
->
base_url
,
false
);
if
(
is_array
(
$res
)
&&
0
==
$res
[
'code'
])
{
if
(
is_array
(
$res
)
&&
count
(
$res
[
'changeRank'
])
>
0
)
{
$key
=
$this
->
quotation_prefix
.
'GHT_USDT'
;
foreach
(
$res
[
'changeRank'
]
as
$val
){
$this
->
redis
->
hmset
(
$key
,
'low'
,
$res
[
'data'
],
'high'
,
$res
[
'data'
],
'last'
,
$res
[
'data'
],
'change'
,
$res
[
'data'
]);
$key
=
$this
->
quotation_prefix
.
str_replace
(
'/'
,
'_'
,
$val
[
'symbol'
]);
if
(
!
$this
->
redis
->
sismember
(
$this
->
supported_symbol
,
'GHTUSDT'
))
{
$this
->
redis
->
hmset
(
$key
,
'low'
,
$val
[
'low'
],
'high'
,
$val
[
'high'
],
'last'
,
$val
[
'close'
],
'change'
,
$val
[
'change'
],
'open'
,
$val
[
'open'
],
'vol'
,
$val
[
'volume'
]);
$this
->
redis
->
sadd
(
$this
->
supported_symbol
,
'GHTUSDT'
);
if
(
!
$this
->
redis
->
sismember
(
$this
->
supported_symbol
,
str_replace
(
'/'
,
''
,
$val
[
'symbol'
])))
{
$this
->
redis
->
sadd
(
$this
->
supported_symbol
,
str_replace
(
'/'
,
''
,
$val
[
'symbol'
]));
}
}
}
}
}
}
}
}
}
\ 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