留言分页
This commit is contained in:
parent
8af59f6f39
commit
6353a2e2c8
|
@ -98,6 +98,7 @@ module Mobile
|
|||
params do
|
||||
requires :token, type: String
|
||||
requires :user_id, type: Integer,desc: '被留言的用户id'
|
||||
requires :page,type:Integer,desc:'请求数据的页码'
|
||||
end
|
||||
get ':user_id/messages' do
|
||||
us = UsersService.new
|
||||
|
|
|
@ -158,7 +158,7 @@ class UsersService
|
|||
# 获取某个用户的所有留言信息
|
||||
def get_all_messages params
|
||||
user = User.find(params[:user_id])
|
||||
jours = user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
|
||||
jours = user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC').page(params[:page] || 1).per(10)
|
||||
jours.update_all(:is_readed => true, :status => false)
|
||||
jours.each do |journal|
|
||||
fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false)
|
||||
|
|
Loading…
Reference in New Issue