mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-07-16 23:18:56 +08:00
操作记录后台查询
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
class Admins::UserActionsController < Admins::BaseController
|
||||
before_action :require_admin
|
||||
|
||||
def index
|
||||
@user_actions = UserAction.order(created_at: :desc)
|
||||
@user_actions = @user_actions.where(action_type: params[:action_type]) if params[:action_type].present?
|
||||
keyword = params[:keyword].to_s.strip.presence
|
||||
if keyword
|
||||
sql = 'login LIKE :keyword OR phone LIKE :keyword OR mail LIKE :keyword'
|
||||
@user_actions = @user_actions.where(sql, keyword: "%#{keyword}%")
|
||||
end
|
||||
@user_actions = paginate @user_actions
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user