Commit f425912a authored by hujun's avatar hujun

bug 进场推送增加判断

parent fb2a1f49
...@@ -221,14 +221,20 @@ class PushMessageService ...@@ -221,14 +221,20 @@ class PushMessageService
*/ */
public function pushAgentAllDeviceId($id, $title, $content, $type = null, $user_id = null) public function pushAgentAllDeviceId($id, $title, $content, $type = null, $user_id = null)
{ {
if (empty($id)) {
return false;
}
$m_agent_device = new ABindingDevice(); $m_agent_device = new ABindingDevice();
$device_id_array = $m_agent_device->getDeviceByAgentId([ 'agent_id' => $id ], 'id,push_id'); $device_id_array = $m_agent_device->getDeviceByAgentId([ 'agent_id' => $id ], 'id,push_id');
if (!empty($device_id_array)) {
foreach ($device_id_array as $k => $v) { foreach ($device_id_array as $k => $v) {
if (!empty($v['push_id'])) { if (!empty($v['push_id'])) {
$this->push->public_push_message_for_one($id, $v['push_id'], $title, $content, $type, $user_id); $this->push->public_push_message_for_one($id, $v['push_id'], $title, $content, $type, $user_id);
} }
} }
}
return true; return true;
} }
......
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