超级管理员的用户列表页,状态为“全部”时,创建时间排序无效

This commit is contained in:
daiao 2017-03-07 09:57:37 +08:00
parent 4bb239a944
commit f8c9ba8566
1 changed files with 1 additions and 3 deletions

View File

@ -475,7 +475,6 @@ class AdminController < ApplicationController
else
@limit = 15#per_page_option
end
@status = params[:status] || 1
scope = User.logged.status(@status)
scope = scope.like(params[:name],params[:search_by][:id]) if params[:name].present?
@ -483,8 +482,7 @@ class AdminController < ApplicationController
@user_pages = Paginator.new @user_count, @limit, params['page']
@user_base_tag = params[:id] ? 'base_users':'base'
@users = scope.offset(@user_pages.offset).limit(@user_pages.per_page)
@users = scope.order(sort_clause).offset(@user_pages.offset).limit(@user_pages.per_page).all
respond_to do |format|
format.html {
@groups = Group.all.sort