员工公告在数据库中存储在哪里?

有人知道如何从数据库中查询员工备注通知吗?我一直在代码中查找,但还没找到它们存储的位置。

我的主要目标是找到上周写的一条特定员工通知,所以我正在寻找一种方法来浏览最近的自定义通知。

编辑:我之前遇到了困难,因为我在查找“员工备注”。我刚刚发现一个 custom_field 可能正是我需要的,但我不确定如何列出所有带有自定义文本的员工通知。

pry(main)> p.custom_fields
=> {"notice_type"=>"new_user"}

PlugintStoreRow.where(plugin_name: "user_notes") 可能正是你要找的。

谢谢,我正在寻找“员工公告”(核心功能),我认为这与“用户笔记”(独立插件)不同。不过我可能搞混了。:slight_smile:

名为“添加员工公告”的项目:

它应该在你提到的自定义字段中

谢谢。如果其他人也在寻找快速浏览数据的方法,以下代码在 Rails 控制台中可以工作:

results = Post.all.reject { |p| p.custom_fields['notice_type'].nil? }

results.each do |r|
  puts r.custom_fields
end

示例输出:

{"notice_type"=>"returning_user", "notice_args"=>"2018-08-04T07:43:52Z"}
{"notice_type"=>"new_user"}
{"notice_type"=>"new_user"}
{"notice_type"=>"new_user"}
{"notice_type"=>"returning_user", "notice_args"=>"2016-10-11T09:32:30Z"}
{"notice_type"=>"returning_user", "notice_args"=>"2014-04-02T16:16:04Z"}
{"notice_type"=>"new_user"}
{"notice_type"=>"new_user"}

我没有看到任何自定义文本,所以我猜我要找的员工通知尚未上线。