fix widget reload_web_links

This commit is contained in:
spen 2014-05-08 14:12:06 +08:00
parent 67640e0fc4
commit bbda5bcfac
1 changed files with 9 additions and 1 deletions

View File

@ -146,7 +146,15 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
@selected_tag = Tag.find(params[:tag_id]).first
@ModuleApp = ModuleApp.first(:conditions => {:key=>'web_resource'})
@link_selected_tag = Tag.first(:conditions => {:name => @selected_tag.name, :module_tag_id => @ModuleApp.id})
@link_module_tag = ModuleTag.first(:conditions => {:name => @selected_tag.name, :module_app_id => @ModuleApp.id})
# @link_selected_tag = Tag.first(:conditions => {:name => @selected_tag.name, :tag_lease_id => @ModuleApp.id})
if !@link_module_tag.blank?
@link_selected_tag = Tag.first(:conditions => {:name => @selected_tag.name, :tag_lease_id => @link_module_tag.id})
else
@link_selected_tag = @link_module_tag
end
@web_links = WebLink.where(:tagged_ids => @link_selected_tag.id.to_s, :is_hidden => false).desc(:is_top,:created_at).available_for_lang(I18n.locale).page(params[:page]).per(@page_num) rescue nil
end