From f15d00aae9c930ea4824de4cf583d453d171b936 Mon Sep 17 00:00:00 2001 From: EZ <123400558@qq.com> Date: Thu, 14 May 2020 23:49:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=91=E9=80=81=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E6=B6=88=E6=81=AF=E7=9A=84=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?appid=E9=9D=9E=E5=BE=AE=E4=BF=A1appid=E5=92=8C=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E5=BE=AE=E4=BF=A1=E6=8E=A8=E9=80=81=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?msgid=E6=9C=89=E5=A4=A7=E5=86=99=E5=92=8C=E5=B0=8F=E5=86=99?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Bean/OfficialAccount/RequestMsg.php | 11 ++++++++++- src/OfficialAccount/TemplateMsg.php | 1 - 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Bean/OfficialAccount/RequestMsg.php b/src/Bean/OfficialAccount/RequestMsg.php index 6e2c559..dfbb786 100644 --- a/src/Bean/OfficialAccount/RequestMsg.php +++ b/src/Bean/OfficialAccount/RequestMsg.php @@ -22,6 +22,7 @@ class RequestMsg extends SplBean protected $MsgType; protected $Content; protected $MsgId; + protected $MsgID; protected $Event; protected $EventKey; protected $Ticket; @@ -125,7 +126,15 @@ public function setContent($Content): void */ public function getMsgId() { - return $this->MsgId; + if (!empty($this->MsgId)) { + return $this->MsgId; + } + + if (!empty($this->MsgID)) { + return $this->MsgID; + } + + return null; } /** diff --git a/src/OfficialAccount/TemplateMsg.php b/src/OfficialAccount/TemplateMsg.php index 2c930e5..25baf9b 100644 --- a/src/OfficialAccount/TemplateMsg.php +++ b/src/OfficialAccount/TemplateMsg.php @@ -26,7 +26,6 @@ public function send(MsgBean $templateMsg) : bool 'ACCESS_TOKEN'=> $this->getOfficialAccount()->accessToken()->getToken() ]); - $templateMsg->setAppid($this->getOfficialAccount()->getConfig()->getAppId()); $response = NetWork::postJsonForJson($url, $templateMsg->getSendMessage()); $this->hasException($response); return true;