1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

dont compute member list if not complete

This commit is contained in:
Peng DU 2016-06-22 17:27:14 +02:00
parent 18c1f19840
commit 1383483a54

View File

@ -252,10 +252,12 @@ class StatisticService
def members_list(options = default_options)
result = []
User.with_role(:member).where('users.created_at >= :start_date AND users.created_at <= :end_date', options).each do |u|
result.push OpenStruct.new({
date: options[:start_date].to_date
}.merge(user_info(u)))
User.with_role(:member).includes(:profile).where('users.created_at >= :start_date AND users.created_at <= :end_date', options).each do |u|
if !u.need_completion?
result.push OpenStruct.new({
date: options[:start_date].to_date
}.merge(user_info(u)))
end
end
result
end