ruby 参展商简介报告

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby 参展商简介报告相关的知识,希望对你有一定的参考价值。

#Reporte de perfil de expositores
#incluye campos custom
event  = Event.find(1894)
custom = CustomField.list("EventReservationProfileFields", event.id, event.created_by, {default: false})
CSV.open("/home/ubuntu/usuga_stand_report.csv", "wb") do |csv|
  header = ["name", "website", "description"]
  header += custom.map{|id, data| data[:name]}
  csv << header
  event.stands.where(status: [2,3]).each do |stand|
    reservation = stand.current_reservation
    next if reservation.blank?
    fields = [ reservation.display_name, reservation.website, reservation.profile_description ]
    fields += custom.map{|id, data| (reservation.profile_data.present? ? reservation.profile_data[id.to_s].to_s : "") }
    csv << fields
  end
end

以上是关于ruby 参展商简介报告的主要内容,如果未能解决你的问题,请参考以下文章

一比一的观众面积比,魅力何在? 2018yarnexpo春夏纱线展观众报告 告诉你

展会 |“一比一的观众面积比”,魅力何在?——“2018yarnexpo春夏纱线展观众报告”告诉你

ruby 令人敬畏的ActiveRecord错误报告脚本。如何在Ruby脚本中使用ActiveRecord和SQLite。

ruby 报告评估台面

ruby 会议报告

ruby 大量消息报告