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
9e130d74
Commit
9e130d74
authored
Feb 15, 2022
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
93e06a7d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
ExchangeBusiness.php
common/business/ExchangeBusiness.php
+1
-2
FactoryService.php
common/service/exchange/factory/FactoryService.php
+2
-2
No files found.
common/business/ExchangeBusiness.php
View file @
9e130d74
...
...
@@ -442,10 +442,9 @@ 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
);
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
[
'rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'last'
]
/
$cny_usd_rate
);
$quotation
[
'low'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'low'
]);
$quotation
[
'high'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'high'
]);
$quotation
[
'last'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'last'
]);
...
...
common/service/exchange/factory/FactoryService.php
View file @
9e130d74
...
...
@@ -41,8 +41,8 @@ abstract class FactoryService
$res
=
json_decode
(
$res
,
true
);
foreach
(
$res
[
'data'
]
as
$val
)
{
$this
->
basic_price
[
$val
[
'name'
]][
'rmb'
]
=
$val
[
'rmb'
];
$this
->
basic_price
[
$val
[
'name'
]][
'usd'
]
=
$val
[
'usd'
];
$this
->
basic_price
[
$val
[
'name'
]][
'rmb'
]
=
$val
[
'rmb'
]
??
0
;
$this
->
basic_price
[
$val
[
'name'
]][
'usd'
]
=
$val
[
'usd'
]
??
0
;
}
$this
->
redis
=
\Yii
::
$app
->
redis
;
...
...
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