|
|
@ -25,11 +25,12 @@ class CompetitionTeamsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
shixun_ids = @shixuns.map(&:id)
|
|
|
|
shixun_ids = @shixuns.map(&:id)
|
|
|
|
@myshixun_count_map = get_valid_myshixun_count(shixun_ids)
|
|
|
|
@myshixun_count_map = get_valid_myshixun_count(shixun_ids)
|
|
|
|
|
|
|
|
@original_myshixun_count_map = @myshixun_count_map.clone
|
|
|
|
# forked shixun valid myshixun count
|
|
|
|
# forked shixun valid myshixun count
|
|
|
|
forked_shixun_map = Shixun.where(status: 2, fork_from: shixun_ids).select('id, fork_from')
|
|
|
|
forked_shixun_map = Shixun.where(status: 2, fork_from: shixun_ids).select('id, fork_from')
|
|
|
|
forked_shixun_map = forked_shixun_map.each_with_object({}) { |sx, obj| obj[sx.id] = sx.fork_from }
|
|
|
|
forked_shixun_map = forked_shixun_map.each_with_object({}) { |sx, obj| obj[sx.id] = sx.fork_from }
|
|
|
|
forked_myshixun_count_map = get_valid_myshixun_count(forked_shixun_map.keys)
|
|
|
|
@forked_myshixun_count_map = get_valid_myshixun_count(forked_shixun_map.keys)
|
|
|
|
forked_myshixun_count_map.each { |k, v| @myshixun_count_map[forked_shixun_map[k]] += v }
|
|
|
|
@forked_myshixun_count_map.each { |k, v| @myshixun_count_map[forked_shixun_map[k]] += v }
|
|
|
|
|
|
|
|
|
|
|
|
@course_count_map = get_valid_course_count(shixun_ids)
|
|
|
|
@course_count_map = get_valid_course_count(shixun_ids)
|
|
|
|
forked_map = get_valid_course_count(forked_shixun_map.keys)
|
|
|
|
forked_map = get_valid_course_count(forked_shixun_map.keys)
|
|
|
@ -38,6 +39,7 @@ class CompetitionTeamsController < ApplicationController
|
|
|
|
@forked_course_count_map[forked_shixun_map[forked_id]] ||= 0
|
|
|
|
@forked_course_count_map[forked_shixun_map[forked_id]] ||= 0
|
|
|
|
@forked_course_count_map[forked_shixun_map[forked_id]] += course_count
|
|
|
|
@forked_course_count_map[forked_shixun_map[forked_id]] += course_count
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
@forked_shixun_map = forked_shixun_map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 课堂
|
|
|
|
# 课堂
|
|
|
|