parent
da48b5ba36
commit
cf18b94326
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@
|
|||
</div>
|
||||
<div style="padding-left: 68px; padding-bottom: 8px">
|
||||
<span>发布时间:<%= format_time c_softapplication.created_at %></span>
|
||||
<span style="padding-left: 50px">最终得分:<%= c_softapplication.softapplication.average(:quality).avg.round(2)%>分</span>
|
||||
<span style="padding-left: 50px">最终得分:<%= c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s%>分</span>
|
||||
|
||||
|
||||
</div>
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
</div>
|
||||
<div style="float: left; padding-left: 100px; padding-top:35px ">
|
||||
<div style="padding-left: 25px;">最终得分</div>
|
||||
<div style="padding-left: 32px; padding-top: 1px; font-size: 15px; color: blue"><%=@softapplication.average(:quality).avg.round(2)%></div>
|
||||
<div style="padding-left: 35px; padding-top: 1px; font-size: 15px; color: blue"><%=@softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s%>分</div>
|
||||
<div style="padding-top: 3px"><%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></div>
|
||||
</div>
|
||||
<div style="float: left; padding-left: 100px; padding-top:35px ">
|
||||
|
|
Loading…
Reference in New Issue