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
a351d2c3
Commit
a351d2c3
authored
6 years ago
by
rlgy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
search coin by name bugfixed
parent
3f4cb231
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
CoinService.php
common/service/coin/CoinService.php
+5
-5
No files found.
common/service/coin/CoinService.php
View file @
a351d2c3
...
...
@@ -35,7 +35,7 @@ class CoinService extends Coin implements CoinInterface
$url
=
Yii
::
$app
->
params
[
'feixiaohao_domain'
]
.
Yii
::
$app
->
params
[
'feixiaohao_page'
][
'currencies'
]
.
$this
->
sid
.
'/'
;
$ch
=
new
Curl
();
$content
=
$ch
->
get
(
$url
,
true
);
$this
->
content
=
$content
;
$this
->
content
=
str_replace
([
' '
,
' '
],
''
,
$content
)
;
}
/**
...
...
@@ -139,9 +139,9 @@ class CoinService extends Coin implements CoinInterface
if
(
empty
(
$this
->
content
))
{
$this
->
init
();
}
preg_match_all
(
'/<div class=lowHeight>(.*?)<\/div><div class=sub>/is'
,
$
$
this
->
content
,
$matchs
);
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
(
$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
{
...
...
@@ -168,9 +168,9 @@ class CoinService extends Coin implements CoinInterface
if
(
empty
(
$this
->
content
))
{
$this
->
init
();
}
preg_match_all
(
'/<div class=lowHeight>(.*?)<\/div><div class=sub>/is'
,
$
$
this
->
content
,
$matchs
);
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
(
$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
{
...
...
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