added first to query for the module timing

This commit is contained in:
Harry Bomrah 2016-01-05 15:59:48 +08:00
parent 9455e14ebf
commit d305c5b6df
1 changed files with 9 additions and 9 deletions

View File

@ -125,16 +125,16 @@ class Admin::AdminModulesController < OrbitAdminController
registered_sites = [] registered_sites = []
times = [] times = []
if !rm.nil? if !rm.nil?
rss = RegisteredSite.active rss = RegisteredSite.active
rss.each do |rs| rss.each do |rs|
if access.nil? if access.nil?
im = InstalledModule.where(:r_module => rm.id, :registered_site_id => rs.id) im = InstalledModule.where(:r_module => rm.id, :registered_site_id => rs.id)
else else
im = InstalledModule.where(:r_module => rm.id, :registered_site_id => rs.id,:permission_granted => access) im = InstalledModule.where(:r_module => rm.id, :registered_site_id => rs.id,:permission_granted => access)
end end
if im.count > 0 if im.count > 0
registered_sites << rs registered_sites << rs
times << im.created_at.strftime("%Y-%m-%d %H:%M") rescue "" times << im.first.created_at.strftime("%Y-%m-%d %H:%M") rescue ""
end end
end end
end end