Commit dbadc3ea authored by shajiaiming's avatar shajiaiming

增加标题

parent ee488ff2
......@@ -24,7 +24,7 @@ class CoinDogController extends BaseController
$signString = http_build_query($signParams);
$httpParams['sign'] = strtolower(md5($signString));
$url = $coindog['article'].'?'.http_build_query($httpParams);
$url = $coindog['article'] . '?' . http_build_query($httpParams);
$curl = new Curl();
$resp = $curl->get($url, false);
return ['code' => 200, 'data' => $resp, 'msg' => 'ok'];
......@@ -37,7 +37,6 @@ class CoinDogController extends BaseController
$flag = Yii::$app->request->get('flag', 'down');
$coindog = Yii::$app->params['coindog'];
$accessKey = $coindog['accessKey'];
......@@ -59,16 +58,20 @@ class CoinDogController extends BaseController
'flag' => $flag
];
$url = $coindog['live'].'?'.http_build_query($httpParams);
$url = $coindog['live'] . '?' . http_build_query($httpParams);
$curl = new Curl();
$resp = $curl->get($url, false);
if(!isset($resp['list'])) {
if (!isset($resp['list'])) {
$msg = '数据不存在';
$code = -1;
$data = null;
goto doEnd;
}
$list = $resp['list'][0]['lives'];
foreach ($list as &$item) {
preg_match_all("/\【(.+?)\】/", $item['content'], $match);
$item['title'] = $match[1][0];
}
$code = 0;
$msg = 'success';
doEnd :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment