Sha256: a3db1beec80bed2b8f80312964a19041ba41bd1fced2209a7edc6c16bce348d6
Contents?: true
Size: 1.71 KB
Versions: 3
Compression:
Stored size: 1.71 KB
Contents
follow_ups_count = 0 json.data do json.array! @businesses do |d| json.id d.id json.name d.name json.department d.department.name json.school d.department.school.name json.school_id d.department.school.id json.follow_ups_count d.follow_ups_count follow_ups_count += d.follow_ups_count json.follow_up_id d.last_follow_up_id # json.teachers_count d.follow_ups.sum(:key_people_count) # json.teachers_count EducodeSales::FollowUp.order(created_at: :desc).find_by(business_id: d.id).present? ? EducodeSales::FollowUp.order(created_at: :desc).find_by(business_id: d.id).key_people_count : 0 json.clazz d.last_follow_up&.clazz&.name || "" json.stage d.last_follow_up&.stage&.name json.invitation_at d.last_follow_up&.invitation_at.to_s json.reception_at d.last_follow_up&.reception_at.to_s json.bidded_date d.last_follow_up&.bidded_date.to_s json.signed_date d.last_follow_up&.signed_date.to_s json.total_amount d.last_follow_up&.total_amount json.actual_amount d.last_follow_up&.actual_amount json.return_money d.return_money json.place d.last_follow_up&.place&.name json.last_follow_person d.last_follow_up.present? ? d.last_follow_up.staff.user.real_name : EducodeSales::Staff.find(d.staff_id).user.real_name json.source d.source json.assign_follow_ups d.last_follow_up.present? ? d.last_follow_up.assign_follow_ups.pluck(:staff_id) : [] json.current_staff_id @current_admin.id json.staff_id d.staff_id json.latest_time d.last_follow_up.present? ? d.last_follow_up.created_at.to_s : d.created_at.to_s end end json.totalRow do json.follow_ups_count follow_ups_count.to_s end json.code 0 json.count @businesses.total_count json.msg 'succcess'
Version data entries
3 entries across 3 versions & 1 rubygems