add clear

This commit is contained in:
as2252258@163.com
2020-03-05 12:36:55 +08:00
parent 56cc706c67
commit 0a16cc14e4
2 changed files with 10 additions and 9 deletions
+7 -7
View File
@@ -123,18 +123,18 @@ class Template extends SmallProgram
{
$url = $this->sendUrl . '?access_token=' . $this->config->getAccessToken();
$params = json_encode([
"touser" => $this->openId,
$params = [
"touser" => $this->openId,
"template_id" => $this->templateId,
"page" => $this->page,
"form_id" => $this->formId,
"data" => $this->keywords,
], JSON_UNESCAPED_UNICODE);
"page" => $this->page,
"form_id" => $this->formId,
"data" => $this->keywords,
];
if (!empty($this->emphasis_keyword)) {
$params['emphasis_keyword'] = $this->emphasis_keyword;
}
$params = json_encode($params, JSON_UNESCAPED_UNICODE);
$this->request->setIsSSL(true);
$this->request->addHeader('content-type', 'application/json');
+3 -2
View File
@@ -121,17 +121,18 @@ class Template extends SmallProgram
public function sendTemplate()
{
$url = $this->sendUrl . '?access_token=' . $this->config->getAccessToken();
$params = json_encode([
$params = [
"touser" => $this->openId,
"template_id" => $this->templateId,
"page" => $this->page,
"form_id" => $this->formId,
"data" => $this->keywords,
], JSON_UNESCAPED_UNICODE);
];
if (!empty($this->emphasis_keyword)) {
$params['emphasis_keyword'] = $this->emphasis_keyword;
}
$params = json_encode($params, JSON_UNESCAPED_UNICODE);
$this->request->setIsSSL(true);
$this->request->addHeader('content-type', 'application/json');