From f1799745df212fd96176680dbf7b0906256eb4d4 Mon Sep 17 00:00:00 2001 From: jerry Date: Fri, 9 Feb 2018 18:40:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B6=88=E6=81=AF=E5=8F=91?= =?UTF-8?q?=E9=80=81=E5=A4=B1=E8=B4=A5=EF=BC=8C=E6=97=A5=E5=BF=97=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Listeners/LogNotification.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/Listeners/LogNotification.php b/app/Listeners/LogNotification.php index 1c98aa8..bf4cf04 100644 --- a/app/Listeners/LogNotification.php +++ b/app/Listeners/LogNotification.php @@ -18,7 +18,8 @@ public function handle(NotificationSent $event) { // openid is null if ($event->response == null) { - Log::warning('openid不能为空', $event->notifiable); + + Log::warning('openid不能为空', $this->object2array($event->notifiable)); } if ($event->response->errcode == 0) { @@ -27,4 +28,17 @@ public function handle(NotificationSent $event) // on error } } + + public function object2array($object) + { + $array = array(); + if (is_object($object)) { + foreach ($object as $key => $value) { + $array[$key] = $value; + } + } else { + $array = $object; + } + return $array; + } }