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
dbadc3ea
Commit
dbadc3ea
authored
Aug 06, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加标题
parent
ee488ff2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
CoinDogController.php
api/controllers/CoinDogController.php
+10
-6
No files found.
api/controllers/CoinDogController.php
View file @
dbadc3ea
...
@@ -24,10 +24,10 @@ class CoinDogController extends BaseController
...
@@ -24,10 +24,10 @@ class CoinDogController extends BaseController
$signString
=
http_build_query
(
$signParams
);
$signString
=
http_build_query
(
$signParams
);
$httpParams
[
'sign'
]
=
strtolower
(
md5
(
$signString
));
$httpParams
[
'sign'
]
=
strtolower
(
md5
(
$signString
));
$url
=
$coindog
[
'article'
]
.
'?'
.
http_build_query
(
$httpParams
);
$url
=
$coindog
[
'article'
]
.
'?'
.
http_build_query
(
$httpParams
);
$curl
=
new
Curl
();
$curl
=
new
Curl
();
$resp
=
$curl
->
get
(
$url
,
false
);
$resp
=
$curl
->
get
(
$url
,
false
);
return
[
'code'
=>
200
,
'data'
=>
$resp
,
'msg'
=>
'ok'
];
return
[
'code'
=>
200
,
'data'
=>
$resp
,
'msg'
=>
'ok'
];
}
}
public
function
actionLive
()
public
function
actionLive
()
...
@@ -37,7 +37,6 @@ class CoinDogController extends BaseController
...
@@ -37,7 +37,6 @@ class CoinDogController extends BaseController
$flag
=
Yii
::
$app
->
request
->
get
(
'flag'
,
'down'
);
$flag
=
Yii
::
$app
->
request
->
get
(
'flag'
,
'down'
);
$coindog
=
Yii
::
$app
->
params
[
'coindog'
];
$coindog
=
Yii
::
$app
->
params
[
'coindog'
];
$accessKey
=
$coindog
[
'accessKey'
];
$accessKey
=
$coindog
[
'accessKey'
];
...
@@ -59,20 +58,24 @@ class CoinDogController extends BaseController
...
@@ -59,20 +58,24 @@ class CoinDogController extends BaseController
'flag'
=>
$flag
'flag'
=>
$flag
];
];
$url
=
$coindog
[
'live'
]
.
'?'
.
http_build_query
(
$httpParams
);
$url
=
$coindog
[
'live'
]
.
'?'
.
http_build_query
(
$httpParams
);
$curl
=
new
Curl
();
$curl
=
new
Curl
();
$resp
=
$curl
->
get
(
$url
,
false
);
$resp
=
$curl
->
get
(
$url
,
false
);
if
(
!
isset
(
$resp
[
'list'
]))
{
if
(
!
isset
(
$resp
[
'list'
]))
{
$msg
=
'数据不存在'
;
$msg
=
'数据不存在'
;
$code
=
-
1
;
$code
=
-
1
;
$data
=
null
;
$data
=
null
;
goto
doEnd
;
goto
doEnd
;
}
}
$list
=
$resp
[
'list'
][
0
][
'lives'
];
$list
=
$resp
[
'list'
][
0
][
'lives'
];
foreach
(
$list
as
&
$item
)
{
preg_match_all
(
"/\【(.+?)\】/"
,
$item
[
'content'
],
$match
);
$item
[
'title'
]
=
$match
[
1
][
0
];
}
$code
=
0
;
$code
=
0
;
$msg
=
'success'
;
$msg
=
'success'
;
doEnd
:
doEnd
:
return
[
'code'
=>
$code
,
'data'
=>
$list
,
'msg'
=>
$msg
];
return
[
'code'
=>
$code
,
'data'
=>
$list
,
'msg'
=>
$msg
];
}
}
}
}
\ 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