json.data do json.array! @ideas do |d| json.(d, :id, :name, :level, :status, :types, :model, :content) json.school d.school_name json.staff d.staff&.user&.real_name json.hardware d.hardware json.project d.project json.money d.money json.end_time d.end_time.to_s json.creator d.creator&.user&.real_name json.deleter d.deleter&.user&.real_name json.created_at d.created_at.to_s(:date) json.history_type EducodeSales::Idea.where(school_id: d.school_id).size.to_i >= 2 ? "有" : "无" end end json.code 0 json.count @ideas.total_count