This commit is contained in:
whimlex 2015-04-21 17:57:39 +08:00
commit 9fa3d25e3f
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)
end
@is_remote = true
@result_count = results.count
@results = paginateHelper results, 10
#@result_count = results.count
#@results = paginateHelper results, 10
@results = results
@search_name = q
end
@ -315,13 +316,15 @@ class CoursesController < ApplicationController
when '1'
@subPage_title = l :label_teacher_list
@all_members = searchTeacherAndAssistant(@course)
@members = paginateHelper @all_members, 10
#@members = paginateHelper @all_members, 10
@members = @all_members
when '2'
@subPage_title = l :label_student_list
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
@all_members = student_homework_score(0,page, 10,"desc")
# @all_members = @course.members
@members = paginateHelper_for_members @all_members, 10
# @members = paginateHelper_for_members @all_members, 10
@members = @all_members
end
respond_to do |format|
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
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
else

View File

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