|
|
|
@ -12,4 +12,13 @@ class CourseSecondCategory < ApplicationRecord
|
|
|
|
|
category_type == "graduation" && name == "毕设任务" ? "graduation_tasks" : category_type
|
|
|
|
|
)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def homework_publish_count
|
|
|
|
|
homework_commons.select{|homework| homework.publish_time.present? && homework.publish_time <= Time.now}.size
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def homework_unpublish_count
|
|
|
|
|
homework_commons.select{|homework| homework.publish_time.nil? || homework.publish_time > Time.now}.size
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|