diff --git a/app/controllers/cooperates_controller.rb b/app/controllers/cooperates_controller.rb index 1f43fcaa..09895193 100644 --- a/app/controllers/cooperates_controller.rb +++ b/app/controllers/cooperates_controller.rb @@ -2,11 +2,11 @@ class CooperatesController < ApplicationController def partner_list search = params[:search] - @schools = School.where(id: [179, 3181, 3216]).where("name like ?", "'%#{search}%'") + @schools = School.where(id: [117, 179, 3181, 3216]) @all_count = @schools.size unless search.blank? - @schools = @schools.where("name like ?", "'%#{search}%'") + @schools = @schools.where("name like ?", "%#{search}%") end @search_count = @schools.size @schools = paginateHelper @schools, 15 diff --git a/app/models/school.rb b/app/models/school.rb index 2d69bf00..98158c5d 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -58,4 +58,8 @@ class School < ActiveRecord::Base myshixun_id !=0").first.try(:sw_count) end + def statistic_url + dep = departments.where("identifier is not null").first + url = dep.present? ? "/colleges/#{dep.identifier}/statistics" : "" + end end diff --git a/app/views/managements/_users_list.html.erb b/app/views/cooperates/_partner_item.html.erb similarity index 54% rename from app/views/managements/_users_list.html.erb rename to app/views/cooperates/_partner_item.html.erb index 993c6db3..a094c452 100644 --- a/app/views/managements/_users_list.html.erb +++ b/app/views/cooperates/_partner_item.html.erb @@ -9,29 +9,26 @@ 使用详情