Add debug data for mqtt sending to user app #159

This commit is contained in:
Kendrick Chan 2018-07-19 10:03:37 +08:00
parent b586f6486d
commit 2a1f0977c7

View file

@ -37,7 +37,10 @@ class MQTTClient
$sessions = $job_order->getCustomer()->getMobileSessions();
if (count($sessions) == 0)
{
error_log("no sessions to send mqtt event to");
return;
{
// send to every customer session
foreach ($sessions as $sess)
@ -45,6 +48,8 @@ class MQTTClient
$phone_num = $sess->getPhoneNumber();
$channel = self::PREFIX . $phone_num;
$this->publish($channel, json_encode($payload));
error_log("sent to $channel");
}
}