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 = []
times = []
if !rm.nil?
rss = RegisteredSite.active
rss.each do |rs|
if access.nil?
im = InstalledModule.where(:r_module => rm.id, :registered_site_id => rs.id)
else
im = InstalledModule.where(:r_module => rm.id, :registered_site_id => rs.id,:permission_granted => access)
end
if im.count > 0
rss = RegisteredSite.active
rss.each do |rs|
if access.nil?
im = InstalledModule.where(:r_module => rm.id, :registered_site_id => rs.id)
else
im = InstalledModule.where(:r_module => rm.id, :registered_site_id => rs.id,:permission_granted => access)
end
if im.count > 0
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