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