Change Bug

This commit is contained in:
sylor_huang@126.com 2020-10-14 16:24:47 +08:00
parent 1f42076d20
commit d5e57da6d4
4 changed files with 11 additions and 5 deletions

View File

@ -132,7 +132,7 @@ module ApiIndexHelper
def set_children_sections(objects,is_detail)
children_sections_array = []
objects.find_each do |sec|
image = sec.attachments&.last
image = sec.image_attachment
s_section = {
id: sec.id,
title: sec.title

View File

@ -13,7 +13,8 @@ module Watchable
end
def watched_by?(user)
!!(user && self.watcher_user_ids && self.watcher_user_ids.detect {|uid| uid == user.id })
watcher_users.exists?(id: user.id)
# !!(user && self.watcher_user_ids && self.watcher_user_ids.detect {|uid| uid == user.id })
end
def watch!(watchable)

View File

@ -477,9 +477,9 @@ class MemosService
set_msg = "您没有权限"
end
memos = Memo.field_for_list.includes(:praise_tread, :author).where(:root_id => nil).order("sticky=1 desc, #{s_order} desc").limit(15)
memo_list = memo_data memos
{status: set_status, message: set_msg, memo_list: memo_list}
# memos = Memo.field_for_list.includes(:praise_tread, :author, :forums).where(:root_id => nil).order("sticky=1 desc, #{s_order} desc").limit(15)
# memo_list = memo_data memos
{status: set_status, message: set_msg}
end

View File

@ -0,0 +1,5 @@
class AddWatchersCountToMemos < ActiveRecord::Migration[5.2]
def change
add_column :memos, :watchers_count, :integer, default: 0
end
end