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
24a108c2
Commit
24a108c2
authored
Jul 09, 2018
by
rlgy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口数据格式修改
parent
1879956d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
7 deletions
+18
-7
ExchangeBusiness.php
common/business/ExchangeBusiness.php
+4
-4
CoinService.php
common/service/coin/CoinService.php
+3
-3
CoinYCCService.php
common/service/coin/CoinYCCService.php
+11
-0
No files found.
common/business/ExchangeBusiness.php
View file @
24a108c2
...
...
@@ -131,10 +131,10 @@ class ExchangeBusiness
//使用Coin服务
$coinServer
=
CoinFactory
::
createCoin
(
$row
[
'name'
],
$row
[
'id'
],
$row
[
'sid'
]);
$rows
[
$key
][
'sid'
]
=
ucfirst
(
$rows
[
$key
][
'sid'
]);
$rows
[
$key
][
'rmb'
]
=
$coinServer
->
getPrice
(
);
$rows
[
$key
][
'last'
]
=
$coinServer
->
getDollar
(
);
$rows
[
$key
][
'low'
]
=
$coinServer
->
getLow
(
);
$rows
[
$key
][
'high'
]
=
$coinServer
->
getHigh
(
);
$rows
[
$key
][
'rmb'
]
=
sprintf
(
"%0.2f"
,
$coinServer
->
getPrice
()
);
$rows
[
$key
][
'last'
]
=
sprintf
(
"%0.4f"
,
$coinServer
->
getDollar
()
);
$rows
[
$key
][
'low'
]
=
sprintf
(
"%0.2f"
,
$coinServer
->
getLow
()
);
$rows
[
$key
][
'high'
]
=
sprintf
(
"%0.2f"
,
$coinServer
->
getHigh
()
);
$coinServer
->
__destruct
();
}
$rows
[
$key
]
=
array_merge
(
$rows
[
$key
],
$quotation
);
...
...
common/service/coin/CoinService.php
View file @
24a108c2
...
...
@@ -141,11 +141,11 @@ class CoinService extends Coin implements CoinInterface
}
preg_match_all
(
'/<div class=lowHeight>(.*?)<\/div><div class=sub>/is'
,
$this
->
content
,
$matchs
);
preg_match_all
(
'/<span class=value>(.*?)<\/span>/is'
,
$matchs
[
1
][
0
],
$matchs
);
$this
->
setHigh
(
str_replace
([
'
$'
,
'≈
'
,
','
],
''
,
$matchs
[
1
][
0
]));
$this
->
setHigh
(
str_replace
([
'
¥
'
,
','
],
''
,
$matchs
[
1
][
0
]));
Yii
::
$app
->
cache
->
set
(
$this
->
cache_key_prifx
.
$this
->
sid
.
'_high'
,
$this
->
high
,
Yii
::
$app
->
params
[
'curl_cache_time'
][
'quotation'
]);
}
else
{
$this
->
set
Btc
(
$result
);
$this
->
set
High
(
$result
);
}
return
$this
->
high
;
}
...
...
@@ -170,7 +170,7 @@ class CoinService extends Coin implements CoinInterface
}
preg_match_all
(
'/<div class=lowHeight>(.*?)<\/div><div class=sub>/is'
,
$this
->
content
,
$matchs
);
preg_match_all
(
'/<span class=value>(.*?)<\/span>/is'
,
$matchs
[
1
][
0
],
$matchs
);
$this
->
setLow
(
str_replace
([
'
$'
,
'≈
'
,
','
],
''
,
$matchs
[
1
][
1
]));
$this
->
setLow
(
str_replace
([
'
¥
'
,
','
],
''
,
$matchs
[
1
][
1
]));
Yii
::
$app
->
cache
->
set
(
$this
->
cache_key_prifx
.
$this
->
sid
.
'_low'
,
$this
->
low
,
Yii
::
$app
->
params
[
'curl_cache_time'
][
'quotation'
]);
}
else
{
...
...
common/service/coin/CoinYCCService.php
View file @
24a108c2
...
...
@@ -84,4 +84,14 @@ class CoinYCCService extends Coin implements CoinInterface
return
0
;
}
public
function
getHigh
()
{
return
0.2
;
}
public
function
getLow
()
{
return
0.2
;
}
}
\ No newline at end of file
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