|
|
|
@ -336,11 +336,11 @@ class ContestsController < ApplicationController
|
|
|
|
|
##取出参赛应用
|
|
|
|
|
@softapplication = Softapplication.all
|
|
|
|
|
@contesting_softapplication = @contest.contesting_softapplications.
|
|
|
|
|
joins("LEFT JOIN softapplications ON contesting_softapplications.softapplication_id=softapplications.id").
|
|
|
|
|
joins("LEFT JOIN seems_rateable_cached_ratings ON seems_rateable_cached_ratings.cacheable_id=softapplications.id").
|
|
|
|
|
where("seems_rateable_cached_ratings.cacheable_type='Softapplication'").
|
|
|
|
|
where("seems_rateable_cached_ratings.dimension = 'quality'").
|
|
|
|
|
order("seems_rateable_cached_ratings.avg").reverse_order
|
|
|
|
|
joins("LEFT JOIN softapplications ON contesting_softapplications.softapplication_id=softapplications.id").
|
|
|
|
|
joins("LEFT JOIN (
|
|
|
|
|
SELECT * FROM seems_rateable_cached_ratings WHERE cacheable_type='Softapplication' AND DIMENSION = 'quality') AS cached
|
|
|
|
|
ON cached.cacheable_id=softapplications.id").
|
|
|
|
|
order("cached.avg").reverse_order
|
|
|
|
|
@contesting_softapplication = paginateHelper @contesting_softapplication, 10
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|