params['coindog']; $accessKey = $coindog['accessKey']; $secretKey = $coindog['secretKey']; $httpParams = array( 'access_key' => $accessKey, 'date' => time() ); $signParams = array_merge($httpParams, array('secret_key' => $secretKey)); ksort($signParams); $signString = http_build_query($signParams); $httpParams['sign'] = strtolower(md5($signString)); $url = $coindog['article'].'?'.http_build_query($httpParams); $curl = new Curl(); $resp = $curl->get($url, false); return ['code' => 200, 'data' => $resp, 'msg' => 'ok']; } public function actionLive() { $limit = Yii::$app->request->get('limit', 20); $id = Yii::$app->request->get('id', 0); $flag = Yii::$app->request->get('flag', 'down'); $coindog = Yii::$app->params['coindog']; $accessKey = $coindog['accessKey']; $secretKey = $coindog['secretKey']; $httpParams = array( 'access_key' => $accessKey, 'date' => time() ); $signParams = array_merge($httpParams, array('secret_key' => $secretKey)); ksort($signParams); $signString = http_build_query($signParams); $httpParams['sign'] = strtolower(md5($signString)); $httpParams['limit'] = $limit; $httpParams['id'] = $id; $httpParams['flag'] = $flag; $url = $coindog['live'].'?'.http_build_query($httpParams); $curl = new Curl(); $resp = $curl->get($url, false); echo json_encode($resp);exit; } }