Sha256: b0426549804f2055609180af8b8affd5bd252371b2df420c3dd3bdbe43799a3e

Contents?: true

Size: 819 Bytes

Versions: 195

Compression:

Stored size: 819 Bytes

Contents

counts = 0
json.data do
  json.array! @sale_plans do |d|
    json.id d.id
    json.staff d.staff.user.real_name
    json.teacher_name d.teacher.name
    json.department d.teacher.department&.name
    json.school d.teacher.department&.school&.name
    json.month d.month.strftime("%Y-%m")
    json.week d.weekly
    json.teacher_id d.teacher_id
    json.content d.content.truncate(30)
    count = d.teacher.teacher_follows_count
    json.count count
    counts += count
    json.finish_rate "#{d.finish_rate}%"
    json.updated_at d.updated_at.to_s
  end
end

json.totalRow do
  sum = @sale_plans.inject(0) { |score, i| score + i.finish_rate}
  json.finish_rate ( @sale_plans.size > 0 ? (sum.to_f / @sale_plans.size).round(2).to_s : '0' ) + '%'
  json.count counts.to_s
end
json.code 0
json.count @sale_plans.total_count

Version data entries

195 entries across 195 versions & 1 rubygems

Version Path
educode_sales-0.5.9 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-0.5.8 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-0.5.7 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-0.5.6 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-0.5.5 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-0.5.4 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-0.5.3 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-0.5.2 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-0.5.1 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-0.5.0 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-0.4.9 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-0.4.8 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-0.4.7 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-0.4.6 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-0.4.5 app/views/educode_sales/operation_plans/index.json.jbuilder