From 849af9b04b9135f77ff6f356695676365985c79f Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 29 May 2015 14:22:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AF=84=E8=AE=BA=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E6=8B=89=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/comments.rb | 1 + app/services/comment_service.rb | 2 +- app/services/users_service.rb | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/api/mobile/apis/comments.rb b/app/api/mobile/apis/comments.rb index 544ebf0ce..86132a93a 100644 --- a/app/api/mobile/apis/comments.rb +++ b/app/api/mobile/apis/comments.rb @@ -91,6 +91,7 @@ module Mobile desc '课程留言列表' params do optional :token, type: String + optional :page,type:Integer,desc:'页数' end get ':id/course_message' do cs = CommentService.new diff --git a/app/services/comment_service.rb b/app/services/comment_service.rb index a742d0eee..2464297da 100644 --- a/app/services/comment_service.rb +++ b/app/services/comment_service.rb @@ -94,7 +94,7 @@ class CommentService def course_messages params,current_user @course = ::Course.find(params[:id]) if (current_user.admin? || @course.is_public == 1 || (@course.is_public == 0 && current_user.member_of_course?(@course))) - @jours = @course.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') + @jours = @course.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC').page(params[:page] ||= 1).per(10) else raise '403' end diff --git a/app/services/users_service.rb b/app/services/users_service.rb index 77cebe0b1..bd85e3340 100644 --- a/app/services/users_service.rb +++ b/app/services/users_service.rb @@ -292,6 +292,7 @@ class UsersService jours end + # 所有的与我相关 def reply_my_messages params,current_user jours = my_personal_messages params,current_user jours1 = my_course_messages params,current_user