diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 3a66aff4..51e13713 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -28,6 +28,15 @@ class ManagementsController < ApplicationController render :json => {status: 1} end + def user_agents + @user_agents = UserAgent.where("user_agents.key is not null") + @agents_count = @user_agents.count + limit = 20 + @agents_pages = Paginator.new @agents_count, limit, params['page'] || 1 + @offset ||= @agents_pages.offset + @user_agents = paginateHelper @user_agents, limit + end + # 实训课程等级体系 def subject_level_system @levels = SubjectLevelSystem.all diff --git a/app/views/layouts/base_management.html.erb b/app/views/layouts/base_management.html.erb index f0fefec5..3392f099 100644 --- a/app/views/layouts/base_management.html.erb +++ b/app/views/layouts/base_management.html.erb @@ -145,6 +145,7 @@
  • <%= link_to "升级通知", update_notice_managements_path %>
  • <%= link_to "门户banner设置", setting_banner_managements_path %>
  • <%= link_to "培训会", training_2018_managements_path %>
  • +
  • <%= link_to "引流情况", user_agents_managements_path %>
  • diff --git a/app/views/managements/_user_agent_list.html.erb b/app/views/managements/_user_agent_list.html.erb new file mode 100644 index 00000000..43886c8d --- /dev/null +++ b/app/views/managements/_user_agent_list.html.erb @@ -0,0 +1,66 @@ + + + + + + + + + + + + + <% @user_agents.each do |ua| %> + <% user = User.find_by_login(ua.key) %> + <% user_extension = user.extensions %> + <% school = user_extension.school %> + + + + + + + + + + <% end %> + +
    ID代理人登录名代理人姓名学校竞赛报名状态ipip负责人
    <%= ua.id %><%= link_to ua.key, user_path(ua.key), :target => "_blank" %><%= link_to user.try(:show_real_name), user_path(user), target:'_blank' %><%= school.name %><%= "--" %><%= ua.ip %><%= "理由" %>
    +
    +
    +
    + +
    +
    +
    + \ No newline at end of file diff --git a/app/views/managements/user_agents.html.erb b/app/views/managements/user_agents.html.erb new file mode 100644 index 00000000..d29e7bec --- /dev/null +++ b/app/views/managements/user_agents.html.erb @@ -0,0 +1,19 @@ +<%= form_tag(url_for(departments_part_managements_path),:id=>"department_part_search",:method => "post",:remote=>true) do %> +
    + + 搜索 + 清除 + <%= link_to "关联代理人",add_departments_part_managements_path(),:class => "task-btn task-btn-green fr mt6 mr30" %> + +
    +<% end %> +
    + <%= render :partial => "managements/user_agent_list" %> +
    + \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index a92555c1..427b4744 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -537,6 +537,7 @@ RedmineApp::Application.routes.draw do ## oauth相关 resources :managements do collection do + get 'user_agents' get 'evaluate_simple' get 'hidden_course' match 'training_2018',:via=>[:get,:post]