Commit 0b223906 by feixiang

公众号发送消息扩展

parent cc967ca6
...@@ -16,7 +16,7 @@ class MpSender implements SenderInterface ...@@ -16,7 +16,7 @@ class MpSender implements SenderInterface
private $data; private $data;
private $user; private $unionId;
private $miniprogram; private $miniprogram;
...@@ -24,9 +24,9 @@ class MpSender implements SenderInterface ...@@ -24,9 +24,9 @@ class MpSender implements SenderInterface
private $template; private $template;
public function __construct(array $user,array $miniprogram, array $sendData, string $template) public function __construct(string $unionId,array $miniprogram, array $sendData, string $template)
{ {
$this->user = $user; $this->unionId = $unionId;
$this->miniprogram = $miniprogram; $this->miniprogram = $miniprogram;
$this->sendData = $sendData; $this->sendData = $sendData;
$this->template = $template; $this->template = $template;
...@@ -35,8 +35,7 @@ class MpSender implements SenderInterface ...@@ -35,8 +35,7 @@ class MpSender implements SenderInterface
public function format() public function format()
{ {
$this->data[$this->sendType] = [ $this->data[$this->sendType] = [
'uid' => $this->user['id'], 'unionId' => $this->unionId,
'storeId' => $this->user['storeId'],
'template_id' => $this->template, 'template_id' => $this->template,
'miniprogram' => [ 'miniprogram' => [
'appid' => $this->miniprogram['appId'], //小程序appid 'appid' => $this->miniprogram['appId'], //小程序appid
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment