From dcc4167e06a58803c8686bc1f23a152e1a68a7a5 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Mon, 12 May 2014 18:31:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E7=AB=9E=E8=B5=9B=E4=B8=AD=E5=8F=82?= =?UTF-8?q?=E8=B5=9B=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8=E7=9A=84=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E6=96=B9=E5=BC=8F=E6=94=B9=E4=B8=BA=E6=8C=89=E6=89=93?= =?UTF-8?q?=E5=88=86=E9=AB=98=E4=BD=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/contests_controller.rb | 7 ++++++- app/views/contests/show_attendingcontest.html.erb | 14 +++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb index 7741333a8..12935d85f 100644 --- a/app/controllers/contests_controller.rb +++ b/app/controllers/contests_controller.rb @@ -335,7 +335,12 @@ class ContestsController < ApplicationController end ##取出参赛应用 @softapplication = Softapplication.all - @contesting_softapplication = @contest.contesting_softapplications.reverse + @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 @contesting_softapplication = paginateHelper @contesting_softapplication, 10 diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index 8a00f12ae..062776a08 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -61,13 +61,13 @@ -
+
温馨提示:如果您希望在我们平台托管参赛数据和代码,请按下面参赛步骤参赛!
<% if User.current.logged? %>
-
+
参赛步骤:
@@ -90,7 +90,7 @@ <%= l(:label_softapplication_name) %> * : <%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %> - +


@@ -98,7 +98,7 @@ <%= l(:label_softapplication_version_available) %> * : <%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %> - +


@@ -107,7 +107,7 @@ * : <%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %> - +


@@ -115,7 +115,7 @@ <%= l(:label_softapplication_description) %> * : <%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %> - +


@@ -123,7 +123,7 @@ <%= l(:label_softapplication_developers) %> * : <%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %> - +