nps数据统计

This commit is contained in:
“xxq250”
2022-09-20 09:41:27 +08:00
parent 6d7b7dd058
commit bb8e6aeaf8
2 changed files with 24 additions and 2 deletions

View File

@@ -8,6 +8,9 @@ class Admins::NpsController < Admins::BaseController
@user_nps = @user_nps.where(sql, keyword: "%#{keyword}%")
end
@user_nps = @user_nps.where("action_type != 'close'") if params[:done_score].present?
@min_score = @user_nps.where("action_type != 'close'").minimum("score")
@max_score = @user_nps.where("action_type != 'close'").maximum("score")
@score_total_count = UserNp.where("action_type !='close'").count
@user_nps = paginate @user_nps.includes(:user)
end