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
5e3cef4f
Commit
5e3cef4f
authored
Mar 10, 2022
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/optimize' into 'master'
fix See merge request
!494
parents
6342a782
b5cdc626
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
ExchangeBusiness.php
common/business/ExchangeBusiness.php
+7
-1
TickerController.php
console/controllers/TickerController.php
+1
-1
No files found.
common/business/ExchangeBusiness.php
View file @
5e3cef4f
...
...
@@ -284,6 +284,12 @@ class ExchangeBusiness
goto
doEnd
;
}
if
(
in_array
(
strtoupper
(
$tag
),
[
'BTY'
,
'YCC'
]))
{
$exchange
=
ExchangeFactory
::
createExchange
(
"Superx"
);
$quotation
=
$exchange
->
getTicker
(
$tag
,
'USDT'
);
goto
doEnd
;
}
if
(
in_array
(
strtoupper
(
$tag
),
[
'CIC'
,
'MC'
]))
{
$exchange
=
ExchangeFactory
::
createExchange
(
"Ztb"
);
$quotation
=
$exchange
->
getTicker
(
strtoupper
(
$tag
),
'USDT'
);
...
...
@@ -442,7 +448,7 @@ class ExchangeBusiness
$exchange
=
ExchangeFactory
::
createExchange
(
"Rate"
);
$rate
=
$exchange
->
getTicker
(
"CNY"
,
"USD"
);
$cny_usd_rate
=
1
/
$rate
[
'last'
];
$quotation
[
'rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'last'
]
/
$cny_usd_rate
);
$quotation
[
'rmb'
]
=
isset
(
$quotation
[
'rmb'
])
?
$quotation
[
'rmb'
]
:
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'last'
]
/
$cny_usd_rate
);
if
(
in_array
(
strtoupper
(
$tag
),
[
'FOLI'
,
'CIC'
,
'MC'
,
'KPC8'
,
'BBD'
,
'BVA'
,
'DAG'
,
'BNC'
,
'BNB'
,
'GHP'
,
'DRA'
,
'ETC'
,
'PAX'
,
'STH'
,
'XJH'
,
'SFT'
,
'TSC'
,
'SUM'
,
'USDW'
,
'FUT'
,
'MBTC'
,
'METH'
,
'GLCW'
,
'HDC'
,
'GWA'
,
'KLG'
,
'LELE'
,
'ZUE'
]))
{
$quotation
[
'usd'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'last'
]);
$quotation
[
'low'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'low'
]);
...
...
console/controllers/TickerController.php
View file @
5e3cef4f
...
...
@@ -63,7 +63,7 @@ class TickerController extends Controller
foreach
(
$div
->
find
(
'td'
)
as
$key
=>
$e
)
{
if
(
$key
==
5
)
{
$key
=
'quotation_boc_'
.
'CNY_'
.
$val
->
currency
->
symbol
;
$currency
=
rtrim
(
sprintf
(
'%.6f'
,
1
/
(
$e
->
innertext
/
100
)),
'0'
);
$currency
=
rtrim
(
sprintf
(
'%.6f'
,
1
/
(
str_replace
(
" "
,
""
,
$e
->
innertext
)
/
100
)),
'0'
);
Yii
::
$app
->
redis_currency
->
hmset
(
$key
,
'low'
,
$currency
,
'high'
,
$currency
,
'last'
,
$currency
,
'open'
,
$currency
);
}
}
...
...
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