Skip to content

Commit

Permalink
修复消息发送失败,日志报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry committed Feb 9, 2018
1 parent f261e9a commit f179974
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion app/Listeners/LogNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}
}

0 comments on commit f179974

Please sign in to comment.