fixed get_bulletins_json of gprs bug

This commit is contained in:
Rueshyna 2012-11-09 10:41:49 +08:00
parent 7595e20d0c
commit 80abfc80bf
1 changed files with 11 additions and 2 deletions

View File

@ -35,11 +35,20 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
else
deadline = I18n.t("no_deadline")
end
@data[I18n.t("category")][b.bulletin_category.title] = { title: b.title,
if @data[I18n.t("category")][b.bulletin_category.title].nil?
@data[I18n.t("category")][b.bulletin_category.title] = Array.new
@data[I18n.t("category")][b.bulletin_category.title] << { title: b.title,
postdate: display_date_time(b.postdate),
deadline: deadline,
tag: b.sorted_tags.to_a,
}
else
@data[I18n.t("category")][b.bulletin_category.title] << { title: b.title,
postdate: display_date_time(b.postdate),
deadline: deadline,
tag: b.sorted_tags.to_a,
}
end
end
render :json => @data.to_json
end