fix user center page limit

dev_ec
p31729568 5 years ago
parent 04bf4bf69f
commit 0de464db47

@ -3,7 +3,7 @@ class Users::CoursesController < Users::BaseController
courses = Users::CourseService.new(observed_user, query_params).call courses = Users::CourseService.new(observed_user, query_params).call
@count = courses.count @count = courses.count
@courses = paginate(courses.includes(teacher: { user_extension: :school }), special: true) @courses = paginate(courses.includes(teacher: { user_extension: :school }), special: observed_user.is_teacher?)
end end
private private

@ -5,7 +5,7 @@ class Users::ProjectsController < Users::BaseController
projects = Users::ProjectService.new(observed_user, query_params).call projects = Users::ProjectService.new(observed_user, query_params).call
@count = projects.count @count = projects.count
@projects = paginate(projects.includes(:project_score, owner: { user_extension: :school }), special: true) @projects = paginate(projects.includes(:project_score, owner: { user_extension: :school }), special: observed_user.is_teacher?)
end end
def search def search

@ -3,7 +3,7 @@ class Users::ShixunsController < Users::BaseController
shixuns = Users::ShixunService.new(observed_user, query_params).call shixuns = Users::ShixunService.new(observed_user, query_params).call
@count = shixuns.count @count = shixuns.count
@shixuns = paginate(shixuns.includes(:first_tag_repertoire), special: true) @shixuns = paginate(shixuns.includes(:first_tag_repertoire), special: observed_user.is_teacher?)
ids = @shixuns.map(&:id) ids = @shixuns.map(&:id)
@finished_challenges_count_map = Game.joins(:myshixun).where(user_id: observed_user.id, status: 2) @finished_challenges_count_map = Game.joins(:myshixun).where(user_id: observed_user.id, status: 2)

@ -3,7 +3,7 @@ class Users::SubjectsController < Users::BaseController
subjects = Users::SubjectService.new(observed_user, query_params).call subjects = Users::SubjectService.new(observed_user, query_params).call
@count = subjects.count @count = subjects.count
@subjects = paginate(subjects.includes(:user, :repertoire), special: true) @subjects = paginate(subjects.includes(:user, :repertoire), special: observed_user.is_teacher?)
end end
private private

Loading…
Cancel
Save