app/views/educode_sales/teachers/index.json.jbuilder in educode_sales-0.9.70 vs app/views/educode_sales/teachers/index.json.jbuilder in educode_sales-0.9.71
- old
+ new
@@ -24,9 +24,16 @@
json.students d.students_count
json.followup_at d.follow_up&.created_at&.to_s
json.latest_time (d['latest_time'] ? DateTime.parse(Time.now.strftime("%Y-%m-%d")) - DateTime.parse(d['latest_time'].strftime("%Y-%m-%d")) : DateTime.parse(Time.now.strftime("%Y-%m-%d")) - DateTime.parse(d.created_at.strftime("%Y-%m-%d"))).to_i
json.staff_manage @staff_manages[d.department&.school&.province]&.join(",")
+ json.sales_manage @sales_manages[d.department&.school&.province]&.join(",")
+
+ if d.department_id
+ json.business_count EducodeSales::Business.where(department_id: d.department_id).size
+ else
+ json.business_count 0
+ end
json.majors d.department&.department_majors&.pluck(:name).present? ? d.department&.department_majors&.pluck(:name).join(",") : ""
json.follow_person d.follow_up&.staff&.user&.real_name || ''
json.created_on d.user.present? ? d.user.created_on.to_s(:date) : ''
\ No newline at end of file