% define_admin_breadcrumbs do %> <% add_admin_breadcrumb('NPS用户调研', admins_nps_path) %> <% end %>
数据统计:
评分用户数/用户总数:<%= @score_total_count %>/<%= UserNp.count %>, 平均评分:<%= UserNp.where("action_type !='close'").average(:score).to_f.round(1) %>, <% @user_nps_mid = @score_total_count % 2 == 0 ? @score_total_count / 2 : (@score_total_count + 1) / 2 %> 评分中位数:<%= UserNp.where("action_type !='close'").order("score").pluck(:score)[@user_nps_mid - 1].to_i %>, 最低评分/评分人数:<%=@min_score.to_i %>/<%= UserNp.where("action_type !='close'").where(score: @min_score).count %>, 最高评分/评分人数:<%=@max_score.to_i %>/<%= UserNp.where("action_type !='close'").where(score: @max_score).count %>
填写意见用户数/用户总数:<%= UserNp.where("LENGTH(memo) >0").count %>/<%= UserNp.count %>, 期待更加丰富的功能:<%= UserNp.where("memo like '%期待更加丰富的功能%'").count %>, 希望有新手引导:<%= UserNp.where("memo like '%希望有新手引导%'").count %>, 提升用户体验:<%= UserNp.where("memo like '%用户体验需进一步提升%'").count %>, 其他:<%= UserNp.where("action_type !='close'").where("LENGTH(memo) >0").where.not(id: UserNp.where("memo like '%期待更加丰富的功能%' or memo like '%希望有新手引导%' or memo like '%用户体验需进一步提升%' ").ids).count %>