counting fixed

This commit is contained in:
Harry Bomrah 2017-05-26 01:19:16 +08:00
parent 56cfee7841
commit c3f317e282
1 changed files with 2 additions and 1 deletions

View File

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