add clear

This commit is contained in:
as2252258@163.com
2020-03-05 13:16:04 +08:00
parent 291e882069
commit 0f954c111f
3 changed files with 9 additions and 5 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ class Subscribe extends AfficialAccount
} }
/** /**
* @return array|mixed|\common\Result * @return array|mixed|\wchat\common\Result
*/ */
public function sendSubscribeMessage() public function sendSubscribeMessage()
{ {
+4 -2
View File
@@ -109,17 +109,19 @@ class Subject extends SmallProgram
public function sendTemplate() public function sendTemplate()
{ {
$url = $this->sendUrl . '?access_token=' . $this->config->getAccessToken(); $url = $this->sendUrl . '?access_token=' . $this->config->getAccessToken();
$params = json_encode([ $params = [
"touser" => $this->openId, "touser" => $this->openId,
"template_id" => $this->templateId, "template_id" => $this->templateId,
"page" => $this->page, "page" => $this->page,
"data" => $this->keywords, "data" => $this->keywords,
], JSON_UNESCAPED_UNICODE); ];
if (!empty($this->emphasis_keyword)) { if (!empty($this->emphasis_keyword)) {
$params['emphasis_keyword'] = $this->emphasis_keyword; $params['emphasis_keyword'] = $this->emphasis_keyword;
} }
$params = json_encode($params, JSON_UNESCAPED_UNICODE);
$this->request->setIsSSL(true); $this->request->setIsSSL(true);
$this->request->addHeader('content-type', 'application/json'); $this->request->addHeader('content-type', 'application/json');
+4 -2
View File
@@ -109,17 +109,19 @@ class Subject extends SmallProgram
public function sendTemplate() public function sendTemplate()
{ {
$url = $this->sendUrl . '?access_token=' . $this->config->getAccessToken(); $url = $this->sendUrl . '?access_token=' . $this->config->getAccessToken();
$params = json_encode([ $params = [
"touser" => $this->openId, "touser" => $this->openId,
"template_id" => $this->templateId, "template_id" => $this->templateId,
"page" => $this->page, "page" => $this->page,
"data" => $this->keywords, "data" => $this->keywords,
], JSON_UNESCAPED_UNICODE); ];
if (!empty($this->emphasis_keyword)) { if (!empty($this->emphasis_keyword)) {
$params['emphasis_keyword'] = $this->emphasis_keyword; $params['emphasis_keyword'] = $this->emphasis_keyword;
} }
$params = json_encode($params, JSON_UNESCAPED_UNICODE);
$this->request->setIsSSL(true); $this->request->setIsSSL(true);
$this->request->addHeader('content-type', 'application/json'); $this->request->addHeader('content-type', 'application/json');