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
6a453f6c
Commit
6a453f6c
authored
5 years ago
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
7e6c5ac3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
5 deletions
+23
-5
TickerController.php
api/controllers/TickerController.php
+17
-5
BinanceBuilder.php
common/service/exchange/factory/BinanceBuilder.php
+2
-0
HuobiBuilder.php
common/service/exchange/factory/HuobiBuilder.php
+2
-0
ZhaobiBuilder.php
common/service/exchange/factory/ZhaobiBuilder.php
+2
-0
No files found.
api/controllers/TickerController.php
View file @
6a453f6c
...
...
@@ -131,12 +131,24 @@ class TickerController extends BaseController
$temp
[
'symbol'
]
=
$val
[
'symbol'
];
$temp
[
'currency'
]
=
strtoupper
(
$tag_first
);
$temp
[
'base_currency'
]
=
strtoupper
(
$tag_second
);
$temp
[
'close'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'last'
]);
$temp
[
'close_rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'last'
]
*
$this
->
basic_price
[
$tag_second
]);
$temp
[
'close'
]
=
(
float
)
sprintf
(
"%0.6f"
,
$quotation
[
'last'
]);
$temp
[
'close_usd'
]
=
(
float
)
sprintf
(
"%0.6f"
,
$quotation
[
'close'
]
*
$this
->
basic_price
[
$tag_second
][
'usd'
]);
$temp
[
'close_rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'close'
]
*
$this
->
basic_price
[
$tag_second
][
'rmb'
]);
$temp
[
'change'
]
=
(
float
)
sprintf
(
"%0.4f"
,
(
$quotation
[
'last'
]
-
$quotation
[
'open'
])
/
$quotation
[
'open'
]
*
100
);
$temp
[
'high'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'high'
]);
$temp
[
'low'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'low'
]);
$temp
[
'platform'
]
=
$val
[
'platform'
];
$temp
[
'high_usd'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'high'
]
*
$this
->
basic_price
[
$tag_second
][
'usd'
]);
$temp
[
'low_usd'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'low'
]
*
$this
->
basic_price
[
$tag_second
][
'usd'
]);
$temp
[
'high_rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'high'
]
*
$this
->
basic_price
[
$tag_second
][
'rmb'
]);
$temp
[
'low_rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'low'
]
*
$this
->
basic_price
[
$tag_second
][
'rmb'
]);
$temp
[
'platform_us'
]
=
$val
[
'platform'
];
if
(
'ZHAOBI'
==
strtoupper
(
$val
[
'platform'
]))
{
$temp
[
'platform_zh'
]
=
'找币'
;
}
if
(
'HUOBI'
==
strtoupper
(
$val
[
'platform'
]))
{
$temp
[
'platform_zh'
]
=
'火币'
;
}
if
(
'BINANCE'
==
strtoupper
(
$val
[
'platform'
]))
{
$temp
[
'platform_zh'
]
=
'币安'
;
}
array_push
(
$data
,
$temp
);
}
$msg
=
'success'
;
...
...
This diff is collapsed.
Click to expand it.
common/service/exchange/factory/BinanceBuilder.php
View file @
6a453f6c
...
...
@@ -40,6 +40,8 @@ class BinanceBuilder extends FactoryService
$temp
[
'low_rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$val
[
'lowPrice'
]
*
$this
->
basic_price
[
$coin
][
'rmb'
]);
$temp
[
'vol'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$val
[
'volume'
]);
$temp
[
'optional'
]
=
false
;
$temp
[
'platform_zh'
]
=
'币安'
;
$temp
[
'platform_us'
]
=
'Binance'
;
array_push
(
$ticker
,
$temp
);
break
;
}
...
...
This diff is collapsed.
Click to expand it.
common/service/exchange/factory/HuobiBuilder.php
View file @
6a453f6c
...
...
@@ -40,6 +40,8 @@ class HuobiBuilder extends FactoryService
$temp
[
'low_rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$val
[
'low'
]
*
$this
->
basic_price
[
$coin
][
'rmb'
]);
$temp
[
'vol'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$val
[
'vol'
]);
$temp
[
'optional'
]
=
false
;
$temp
[
'platform_zh'
]
=
'火币'
;
$temp
[
'platform_us'
]
=
'HuoBi'
;
array_push
(
$ticker
,
$temp
);
break
;
}
...
...
This diff is collapsed.
Click to expand it.
common/service/exchange/factory/ZhaobiBuilder.php
View file @
6a453f6c
...
...
@@ -44,6 +44,8 @@ class ZhaobiBuilder extends FactoryService
$temp
[
'low_rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$val
[
'low'
]
*
$this
->
basic_price
[
$coin
][
'rmb'
]);
$temp
[
'vol'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$val
[
'vol'
]);
$temp
[
'optional'
]
=
false
;
$temp
[
'platform_zh'
]
=
'找币'
;
$temp
[
'platform_us'
]
=
'Zhaobi'
;
array_push
(
$ticker
,
$temp
);
break
;
}
...
...
This diff is collapsed.
Click to expand it.
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