去掉学生列表分页

This commit is contained in:
lizanle 2015-04-21 17:54:49 +08:00
parent 0d26f64afd
commit d6527f1f7e
2 changed files with 11 additions and 8 deletions

View File

@ -191,8 +191,9 @@ class CoursesController < ApplicationController
results = searchmember_by_name(student_homework_score(@group.id,0,0,"desc"), q) results = searchmember_by_name(student_homework_score(@group.id,0,0,"desc"), q)
end end
@is_remote = true @is_remote = true
@result_count = results.count #@result_count = results.count
@results = paginateHelper results, 10 #@results = paginateHelper results, 10
@results = results
@search_name = q @search_name = q
end end
@ -315,13 +316,15 @@ class CoursesController < ApplicationController
when '1' when '1'
@subPage_title = l :label_teacher_list @subPage_title = l :label_teacher_list
@all_members = searchTeacherAndAssistant(@course) @all_members = searchTeacherAndAssistant(@course)
@members = paginateHelper @all_members, 10 #@members = paginateHelper @all_members, 10
@members = @all_members
when '2' when '2'
@subPage_title = l :label_student_list @subPage_title = l :label_student_list
page = params[:page].nil? ? 0 : (params['page'].to_i - 1) page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
@all_members = student_homework_score(0,page, 10,"desc") @all_members = student_homework_score(0,page, 10,"desc")
# @all_members = @course.members # @all_members = @course.members
@members = paginateHelper_for_members @all_members, 10 # @members = paginateHelper_for_members @all_members, 10
@members = @all_members
end end
respond_to do |format| respond_to do |format|
if params[:page] if params[:page]
@ -877,7 +880,7 @@ class CoursesController < ApplicationController
students_for_courses.course_id = #{@course.id} and members.user_id = students_for_courses.student_id AND students_for_courses.course_id = #{@course.id} and members.user_id = students_for_courses.student_id AND
members.user_id NOT IN (SELECT homework_attaches.user_id FROM homework_attaches WHERE homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id} ) members.user_id NOT IN (SELECT homework_attaches.user_id FROM homework_attaches WHERE homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id} )
) )
GROUP BY members.user_id ORDER BY score #{score_sort_by} limit #{start_from}, #{nums}" GROUP BY members.user_id ORDER BY score #{score_sort_by} " #limit #{start_from}, #{nums}"
end end
else else

View File

@ -70,9 +70,9 @@
<% end; reset_cycle %> <% end; reset_cycle %>
</div> </div>
<ul class="wlist"> <!--<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%> <% #= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul> </ul>-->
<% else%> <% else%>
<p class="nodata"> <p class="nodata">
<%= l(:label_no_data) %> <%= l(:label_no_data) %>