From c3f317e28298dcd6bb75e1f838ac5b9361dc387f Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 26 May 2017 01:19:16 +0800 Subject: [PATCH] counting fixed --- app/controllers/member_counselors_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/member_counselors_controller.rb b/app/controllers/member_counselors_controller.rb index 1a888a1..9cfce38 100644 --- a/app/controllers/member_counselors_controller.rb +++ b/app/controllers/member_counselors_controller.rb @@ -8,7 +8,8 @@ class MemberCounselorsController < CUserController total = 0 idx = idx + 1 schools = city.hps_schools.collect do |school| - count = HpsMember.where(:hps_school_id => school.id.to_s).count + members = HpsMember.where(:hps_school_id => school.id.to_s).pluck(:id) + count = HpsFile.where(:hps_member_id.in => members).count total = count + total { "name" => school.name,