client = new Client(['base_uri' => 'https://api.weixin.qq.com']); } /** * @desc 发送公众号消息 * @param $send_data * @return void * @throws \GuzzleHttp\Exception\GuzzleException */ public function sendMsg($send_data) { $access_token = WechatUtil::getAccessToken(); print '
';
        print_r($access_token);
        die;
        $result = $this->client->request('post', 'cgi-bin/message/template/send?access_token=' . $access_token, [
            'json' => $send_data,
        ]);
        $result = json_decode($result->getBody()->getContents(), true);
        raw_log('wechat/send_msg', ['send_data'=>$send_data, 'result'=>$result]);
    }
}