From 746022506d9c88f56fe4ea383b0b3fa77a76618d Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 15 Aug 2014 17:43:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E9=97=AE=E9=A2=98=E3=80=81=E9=A1=B9=E7=9B=AE=E5=BE=97?= =?UTF-8?q?=E5=88=86=E4=B8=8D=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 8 ++++---- app/views/layouts/base_projects.html.erb | 4 ++-- app/views/welcome/index.html.erb | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index eaa96e82a..98b24bc12 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -295,8 +295,8 @@ class UsersController < ApplicationController # 活跃度排序, 就是所谓的得分情况 @s_type = 1 @users = scope. - joins("LEFT JOIN user_scores ON users.id = user_scores.user_id"). - reorder('user_scores.active DESC') + joins("LEFT JOIN option_numbers ON users.id = option_numbers.user_id and option_numbers.score_type = 1"). + reorder('option_numbers.total_score DESC') when '2' # 粉丝数排序 @s_type = 2 @@ -308,8 +308,8 @@ class UsersController < ApplicationController # 默认活跃度排序 @s_type = 1 @users = scope. - joins("LEFT JOIN user_scores ON users.id = user_scores.user_id"). - reorder('user_scores.active DESC') + joins("LEFT JOIN option_numbers ON users.id = option_numbers.user_id and option_numbers.score_type = 1"). + reorder('option_numbers.total_score DESC') end # limit and offset diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index eea7a0f61..d8eb17acd 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -54,7 +54,7 @@