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