#coding=utf-8 class Cooperation < ActiveRecord::Base attr_accessible :mail, :name, :qq, :user_type # def contact_us_title # case user_type # when '1' # "高校合作" # when '2' # '企业合作' # when '3' # '实训投稿' # when '4' # '其他' # end # end # # def contact_us_name # case user_type # when '1' # Cooperation.where(:user_type => '1').map(&:name) # when '2' # Cooperation.where(:user_type => '2').map(&:name) # when '3' # Cooperation.where(:user_type => '3').map(&:name) # when '4' # Cooperation.where(:user_type => '4').map(&:name) # end # end # # def contact_us_qq # case user_type # when '1' # Cooperation.where(:user_type => '1').map(&:qq) # when '2' # Cooperation.where(:user_type => '2').map(&:qq) # when '3' # Cooperation.where(:user_type => '3').map(&:qq) # when '4' # Cooperation.where(:user_type => '4').map(&:qq) # end # end # # def contact_us_mail # case user_type # when '1' # Cooperation.where(:user_type => '1').map(&:mail) # when '2' # Cooperation.where(:user_type => '2').map(&:mail) # when '3' # Cooperation.where(:user_type => '3').map(&:mail) # when '4' # Cooperation.where(:user_type => '4').map(&:mail) # end # end end