dev_aliyun
p31729568 5 years ago
parent 06c46c0ea8
commit f03f68e5fd

@ -160,7 +160,7 @@ class CollegesController < ApplicationController
end
def student_hot_evaluations
games = Game.unscoped().joins(:myshixun).joins('join shixun_tag_repertoires str on str.shixun_id = myshixuns.shixun_id')
games = Game.joins(:myshixun).joins('join shixun_tag_repertoires str on str.shixun_id = myshixuns.shixun_id')
games = games.joins('join tag_repertoires tr on tr.id = str.tag_repertoire_id')
games = games.joins("join user_extensions ue on ue.user_id = myshixuns.user_id and ue.school_id = #{@school.id}")
evaluate_count_map = games.group('tr.name').reorder('sum_games_evaluate_count desc').limit(10).sum('games.evaluate_count')

Loading…
Cancel
Save