按名字排序没有过滤搜索条件
This commit is contained in:
parent
86dc66ebeb
commit
a72bbee503
|
@ -15,7 +15,7 @@ class StudentWorkController < ApplicationController
|
|||
if @show_all
|
||||
if @homework.homework_type == 1 || @is_teacher || User.current.admin?
|
||||
if @order == "name"
|
||||
@stundet_works = @homework.student_works.joins(:user).order("users.lastname #{@b_sort}, users.firstname #{@b_sort}")
|
||||
@stundet_works = search_homework_member @homework.student_works.joins(:user).order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
|
||||
else
|
||||
@stundet_works = search_homework_member @homework.student_works.order("#{@order} #{@b_sort}"),@name
|
||||
end
|
||||
|
@ -25,7 +25,7 @@ class StudentWorkController < ApplicationController
|
|||
@stundet_works = []
|
||||
else
|
||||
if @order == "name"
|
||||
@stundet_works = @homework.student_works.joins(:user).order("users.lastname #{@b_sort}, users.firstname #{@b_sort}")
|
||||
@stundet_works = search_homework_member @homework.student_works.joins(:user).order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
|
||||
else
|
||||
@stundet_works = search_homework_member @homework.student_works.order("#{@order} #{@b_sort}"),@name
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue