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
3c86636c
Commit
3c86636c
authored
Jun 04, 2021
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/ticker' into 'master'
remove . See merge request
!481
parents
60783e18
571ff4bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
MarketController.php
api/controllers/MarketController.php
+6
-3
No files found.
api/controllers/MarketController.php
View file @
3c86636c
...
@@ -68,12 +68,12 @@ class MarketController extends BaseController
...
@@ -68,12 +68,12 @@ class MarketController extends BaseController
if
(
'USDT'
==
strtoupper
(
$base_currency
))
{
if
(
'USDT'
==
strtoupper
(
$base_currency
))
{
$currency_ticker
=
$exchange
->
getTicker
(
$currency
,
'USDT'
);
$currency_ticker
=
$exchange
->
getTicker
(
$currency
,
'USDT'
);
if
(
empty
(
$currency_ticker
)){
if
(
empty
(
$currency_ticker
))
{
$this
->
code
=
-
1
;
$this
->
code
=
-
1
;
$this
->
msg
=
'此交易所暂不支持所选币种!'
;
$this
->
msg
=
'此交易所暂不支持所选币种!'
;
goto
doEnd
;
goto
doEnd
;
}
}
$this
->
data
=
rtrim
(
sprintf
(
'%.6f'
,
$currency_ticker
[
'last'
]),
'0'
);
$this
->
data
=
rtrim
(
sprintf
(
'%.6f'
,
$currency_ticker
[
'last'
]),
'0'
);
goto
doEnd
;
goto
doEnd
;
}
}
...
@@ -85,6 +85,9 @@ class MarketController extends BaseController
...
@@ -85,6 +85,9 @@ class MarketController extends BaseController
goto
doEnd
;
goto
doEnd
;
}
}
$this
->
data
=
rtrim
(
sprintf
(
'%.6f'
,
1
/
$currency_ticker
[
'last'
]),
'0'
);
$this
->
data
=
rtrim
(
sprintf
(
'%.6f'
,
1
/
$currency_ticker
[
'last'
]),
'0'
);
if
(
'.'
==
substr
(
$this
->
data
,
-
1
))
{
$this
->
data
=
rtrim
(
$this
->
data
,
'.'
);
}
goto
doEnd
;
goto
doEnd
;
}
}
...
@@ -109,7 +112,7 @@ class MarketController extends BaseController
...
@@ -109,7 +112,7 @@ class MarketController extends BaseController
'rmb'
=>
(
float
)
sprintf
(
"%0.2f"
,
$base_currency_ticker
[
'last'
]),
'rmb'
=>
(
float
)
sprintf
(
"%0.2f"
,
$base_currency_ticker
[
'last'
]),
];
];
$this
->
data
=
rtrim
(
sprintf
(
'%.6f'
,
$currency_quotation
[
'last'
]
/
$base_currency_quotation
[
'last'
]),
'0'
);
$this
->
data
=
rtrim
(
sprintf
(
'%.6f'
,
$currency_quotation
[
'last'
]
/
$base_currency_quotation
[
'last'
]),
'0'
);
doEnd
:
doEnd
:
...
...
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