dev_aliyun
cxt 5 years ago
parent 742f76b810
commit d16cbd6d18

@ -2322,7 +2322,7 @@ end
def update_subject_member_count
if params[:subject] && params[:member_count]
@subject = Subject.where(:id => params[:subject]).first
@subject.update_attributes(:student_count => params[:member_count]) if @subject.present?
@subject.update_attributes(:student_count => params[:member_count], :participant_count => params[:member_count].to_i * 0.35) if @subject.present?
end
end

@ -10,7 +10,7 @@ class Subject < ActiveRecord::Base
belongs_to :major
# score_count 只能适合在首页使用
attr_accessible :description, :name, :status, :visits, :user_id, :course_list_id, :major_id, :learning_notes, :introduction,
:homepage_show, :score_count, :publish_time, :updated_at, :excellent, :student_count
:homepage_show, :score_count, :publish_time, :updated_at, :excellent, :student_count, :participant_count
has_many :stages, :dependent => :destroy, :order => "stages.position ASC"
has_many :stage_shixuns, :dependent => :destroy

Loading…
Cancel
Save