Sha256: 05446797636d4c2358fae42e46af7394bcae7231d03d53284a2277d5cd4c9226
Contents?: true
Size: 1.13 KB
Versions: 15
Compression:
Stored size: 1.13 KB
Contents
json.data do json.array! @staffs do |d| json.id d.id json.name d.user.real_name json.role d.role&.name json.area d.areas.present? ? d.areas.pluck(:name).join("、") : '' json.business_a d.businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id = ?", @a_clazz&.id).count json.business_b d.businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id = ?", @b_clazz&.id).count json.goal d.businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.stage_id in (?)", @step_ids).sum(:total_amount) json.return_money d.businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").sum("educode_sales_businesses.return_money") json.a_clazz_id @a_clazz&.id json.b_clazz_id @b_clazz&.id end end json.code 0 json.count @staffs.total_count
Version data entries
15 entries across 15 versions & 1 rubygems