app/views/educode_sales/teachers/index.json.jbuilder in educode_sales-1.0.8 vs app/views/educode_sales/teachers/index.json.jbuilder in educode_sales-1.0.9
- old
+ new
@@ -23,10 +23,14 @@
json.mobile d.user&.phone || ''
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(",")
+ assign_staff_manages = []
+ d.assign_staffs.each do |assign|
+ assign_staff_manages << assign.staff&.user&.real_name
+ end
+ json.staff_manage @staff_manages[d.department&.school&.province].present? ? (@staff_manages[d.department&.school&.province] + assign_staff_manages).uniq.join(",") : assign_staff_manages
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
\ No newline at end of file