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
a946a704
Commit
a946a704
authored
Aug 19, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize
parent
e5a57ee8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
ExchangeBusiness.php
common/business/ExchangeBusiness.php
+9
-0
CoinController.php
h5/controllers/CoinController.php
+7
-0
No files found.
common/business/ExchangeBusiness.php
View file @
a946a704
...
...
@@ -150,6 +150,13 @@ class ExchangeBusiness
goto
doEnd
;
}
if
(
in_array
(
strtoupper
(
$tag
),
[
'SUSD'
]))
{
$exchange
=
ExchangeFactory
::
createExchange
(
"Go"
);
$quotation
=
$exchange
->
getTicker
(
'CNY'
,
'USD'
);
$quotation
[
'rmb'
]
=
(
float
)
sprintf
(
"%0.2f"
,
$quotation
[
'last'
]);
goto
doEnd
;
}
if
(
in_array
(
strtoupper
(
$tag
),
[
'SJPY'
]))
{
$exchange
=
ExchangeFactory
::
createExchange
(
"Boc"
);
$quotation
=
$exchange
->
getTicker
(
'CNY'
,
'JPY'
);
...
...
@@ -222,6 +229,8 @@ class ExchangeBusiness
if
(
in_array
(
strtoupper
(
$tag
),
[
'FOLI'
]))
{
$quotation
[
'usd'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'last'
]);
$quotation
[
'rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'last'
]
/
$cny_usd_rate
);
}
else
if
(
in_array
(
strtoupper
(
$tag
),
[
'SUSD'
]))
{
$quotation
[
'usd'
]
=
(
float
)
sprintf
(
"%0.4f"
,
1
);
}
else
{
$quotation
[
'usd'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'rmb'
]
*
$cny_usd_rate
);
}
...
...
h5/controllers/CoinController.php
View file @
a946a704
...
...
@@ -62,6 +62,13 @@ class CoinController extends BaseController
$names
=
[
$names
];
}
$condition
=
$names
;
$platform
=
Yii
::
$app
->
request
->
POST
(
'platform'
,
''
);
if
(
!
empty
(
$platform
))
{
$condition
=
[];
foreach
(
$names
as
$val
)
{
$condition
[]
=
[
$val
,
$platform
];
}
}
$fields
=
[
'id'
,
'sid'
,
'icon'
,
'name'
,
'nickname'
,
'platform'
,
'chain'
,
'address as contract_address'
,
'introduce'
];
$result
=
ExchangeBusiness
::
getApiListForIndex
(
1
,
999
,
$condition
,
$fields
);
if
(
$result
)
{
...
...
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