fixed 发送通知报错

This commit is contained in:
xxq250 2023-06-12 18:10:15 +08:00
parent 89c64e276e
commit a46de1b658
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ class SendTemplateMessageJob < ApplicationJob
receivers_id, template_id, props = args[0], args[1], args[2] receivers_id, template_id, props = args[0], args[1], args[2]
template = MessageTemplate.find_by_id(template_id) template = MessageTemplate.find_by_id(template_id)
return unless template.present? return unless template.present?
receivers = User.where(id: receivers_id).or(User.where(mail: receivers_id)) receivers = User.where("id in(?)", receivers_id).or(User.where(mail: receivers_id))
not_exists_receivers = receivers_id - receivers.pluck(:id) - receivers.pluck(:mail) not_exists_receivers = receivers_id - receivers.pluck(:id) - receivers.pluck(:mail)
receivers_string, content, notification_url = MessageTemplate::CustomTip.get_message_content(receivers, template, props) receivers_string, content, notification_url = MessageTemplate::CustomTip.get_message_content(receivers, template, props)
Notice::Write::CreateService.call(receivers_string, content, notification_url, source, {receivers_id: receivers_id, template_id: template_id, props: props}) Notice::Write::CreateService.call(receivers_string, content, notification_url, source, {receivers_id: receivers_id, template_id: template_id, props: props})