app/views/educode_sales/teachers/index.json.jbuilder in educode_sales-0.4.0 vs app/views/educode_sales/teachers/index.json.jbuilder in educode_sales-0.4.1
- old
+ new
@@ -10,13 +10,11 @@
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]
- # a_id = EducodeSales::TeacherFollow.order(created_at: :desc).find_by(teacher_id: d.id).present? ? EducodeSales::TeacherFollow.order(created_at: :desc).find_by(teacher_id: d.id).attitude_id : 73
- # json.attitude EducodeSales::TeacherFollow.find_by(teacher_id: d.id).present? ? EducodeSales::Common.find(EducodeSales::TeacherFollow.order(created_at: :desc).find_by(teacher_id: d.id).attitude_id).name : ''
json.attitude d.follow_up&.attitude&.name
- json.courses_count d.user_id ? Course.joins(:course_members).where(course_members: {user_id: d.user_id}).distinct("course_id").count : 0
+ json.courses_count d.user_id ? Course.joins(:course_members).where(course_members: {user_id: d.user_id}).where("is_delete = 0 and role != 4 and excellent = 0 and is_hidden = 0").where("start_date is null or start_date <= '#{Date.today}'").distinct(:course_id).count : 0
json.actives d.actives
json.students d.students_count
json.regist_at d.user.present? ? d.user.created_on.to_s(:date) : ''
json.teacher_used d.teacher_used_of_department
end
\ No newline at end of file