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