Commit 1026d6be authored by shajiaiming's avatar shajiaiming

fix

parent 1945be06
...@@ -52,14 +52,27 @@ class CoinDogController extends BaseController ...@@ -52,14 +52,27 @@ class CoinDogController extends BaseController
ksort($signParams); ksort($signParams);
$signString = http_build_query($signParams); $signString = http_build_query($signParams);
$httpParams['sign'] = strtolower(md5($signString)); $httpParams = [
$httpParams['limit'] = $limit; 'sign' => strtolower(md5($signString)),
$httpParams['id'] = $id; 'limit' => $limit,
$httpParams['flag'] = $flag; 'id' => $id,
'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);
echo json_encode($resp);exit; if(!isset($resp['list'])) {
$msg = '数据不存在';
$code = -1;
$data = null;
goto doEnd;
}
$list = $resp['list'][0]['lives'];
$code = 0;
$msg = 'success';
doEnd :
return ['code' => $code, 'data' => $list, 'msg' => $msg];
} }
} }
\ No newline at end of file
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