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 @@