dev_admin
p31729568 6 years ago
parent 9b298eaed5
commit 09280053a1

@ -9,6 +9,8 @@ class Users::PrivateMessagesController < Users::BaseController
query = "SELECT subquery.*, COUNT(*) message_count FROM (#{subquery}) subquery "\ query = "SELECT subquery.*, COUNT(*) message_count FROM (#{subquery}) subquery "\
"GROUP BY subquery.target_id ORDER BY subquery.send_time desc LIMIT #{limit_value} OFFSET #{offset_value}" "GROUP BY subquery.target_id ORDER BY subquery.send_time desc LIMIT #{limit_value} OFFSET #{offset_value}"
@messages = PrivateMessage.select('*').from("(#{query}) AS query").includes(target: :user_extension) @messages = PrivateMessage.select('*').from("(#{query}) AS query").includes(target: :user_extension)
observed_user.private_messages.only_unread.update_all(status: 1)
end end
def create def create

Loading…
Cancel
Save