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-1.10.74 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.73 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.72 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.71 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.70 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.59 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.58 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.49 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.48 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.46 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.41 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.37 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.36 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.35 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.34 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.33 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.31 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.30 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.29 app/views/educode_sales/operation_plans/index.json.jbuilder
educode_sales-1.10.28 app/views/educode_sales/operation_plans/index.json.jbuilder