<?php namespace App\Http\Manager; use App\Utils\HttpRequestTool; use RuntimeException; class HttpChannelSdkManager { /** @var HttpRequestTool */ private $httpMg; public function __construct() { $channelSdkHost = ''; $this->httpMg = new HttpRequestTool($channelSdkHost); } /** * 获取用户信息 * * @return mixed */ public function getUserInfo() { $uri = '/api/TemporaryQrCode/statisticsByToken'; // $data = ['link' => $idAndToken, 'wxh' => $serviceName, 'start_at' => $beginTime, 'end_at' => $endTime]; $data = []; $responseData = $this->httpMg->requestByJson('POST', $uri, $data); if (0 !== (int)$responseData['code']) { throw new RuntimeException($responseData['msg']); } return $responseData['data']; } }