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
70a73eb4
Commit
70a73eb4
authored
Jan 24, 2019
by
ZhuChunYang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
f538a9bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
ServiceController.php
api/controllers/ServiceController.php
+18
-1
Bty.php
common/service/exchange/Bty.php
+1
-1
No files found.
api/controllers/ServiceController.php
View file @
70a73eb4
...
...
@@ -14,6 +14,7 @@ use common\models\psources\Coin;
use
common\models\psources\CoinRecommend
;
use
common\models\psources\MinerFee
;
use
common\service\coin\CoinFactory
;
use
common\service\exchange\ExchangeFactory
;
use
Yii
;
/**
...
...
@@ -39,11 +40,19 @@ class ServiceController extends BaseController
if
(
!
is_array
(
$coinItems
)){
$coinItems
=
[
$coinItems
];
}
$tol_coins
=
[
'ETC'
];
$tickerData
=
[];
if
(
$coinItems
){
foreach
(
$coinItems
as
$item
){
$item
=
strtoupper
(
$item
);
$quotation
=
ExchangeBusiness
::
getquatation
(
$item
);
if
(
in_array
(
$item
,
$tol_coins
)){
$exchange
=
ExchangeFactory
::
createExchange
(
'HuoBi'
);
if
(
$exchange
->
symbolExists
(
$item
))
{
$quotation
=
$exchange
->
getTicker
(
$item
);
}
}
else
{
$quotation
=
ExchangeBusiness
::
getquatation
(
$item
);
}
if
(
!
$quotation
)
{
//使用Coin服务
try
{
...
...
@@ -113,4 +122,12 @@ class ServiceController extends BaseController
}
return
[
'code'
=>
0
,
'data'
=>
$fee
,
'msg'
=>
'旷工费获取成功'
];
}
private
function
getRate
()
{
$exchange
=
ExchangeFactory
::
createExchange
(
"Bty"
);
$rate
=
$exchange
->
getTicker
(
"BTY"
,
"USDT"
);
return
(
float
)
$rate
[
'rmb'
]
/
$rate
[
'last'
];
}
}
common/service/exchange/Bty.php
View file @
70a73eb4
...
...
@@ -12,7 +12,7 @@ class Bty extends Exchange implements ExchangeInterface
{
protected
$supported_symbol
=
'supported_symbol_bty'
;
protected
$quotation_prefix
=
'quotation_bty_'
;
protected
$base_url
=
'http
://40.83.77.188
/api/data/Ticker?sort=cname&platform='
;
protected
$base_url
=
'http
s://zbapi.licai.cn
/api/data/Ticker?sort=cname&platform='
;
/**
* 转化交易对为请求变量
...
...
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