Sha256: 886086359e75580ead6928a8eaf46fab0961b9c26dacc0133f6039ca09c8b74d

Contents?: true

Size: 1.36 KB

Versions: 72

Compression:

Stored size: 1.36 KB

Contents

teacher_follows_count = 0
courses_counts = 0
json.data do
  json.array! @teachers do |d|
    json.id d.id
    json.name d.name
    json.department d.department&.name || ""
    json.school d.department&.school&.name || ""
    json.professional_title d.professional_title
    json.job d.job
    json.user_id d.user_id
    json.login d.user_id ? d.user.login : ''
    json.course_subjects_count d.course_subjects_count
    json.teacher_follows_count d.teacher_follows_count
    json.activities_count d.activity_teachers_count
    json.source EducodeSales::Common.teacher_source_name[d.source_id]
    json.attitude d.follow_up&.attitude&.name
    json.courses_count d.courses_count
    json.actives d.actives
    json.students d.students_count
    json.created_on d.user.present? ? d.user.created_on.to_s(:date) : ''
    json.last_login_on (d.user.present? && d.user.last_login_on.present?) ? d.user.last_login_on.to_s(:date) : ''
    json.teacher_used d.teacher_used
    json.wechat d.wechat
    json.created_at d.created_at.to_s(:date)
    json.teacher_assist d.teacher_assign_follows.map{|t| t.staff.user.real_name}.join(',')
    teacher_follows_count += d.teacher_follows_count
    courses_counts += d.courses_count
  end
end

json.totalRow do
  json.teacher_follows_count teacher_follows_count.to_s
  json.courses_count courses_counts.to_s
end
json.code 0
json.count @teachers.total_count

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
educode_sales-0.9.46 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.45 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.44 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.43 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.42 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.41 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.40 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.39 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.38 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.37 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.36 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.35 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.34 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.33 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.32 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.31 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.30 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.29 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.28 app/views/educode_sales/teachers/index.json.jbuilder
educode_sales-0.9.27 app/views/educode_sales/teachers/index.json.jbuilder