Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def outlet_coverages
- d = []
- Store.by_customer_and_city(params[:customer_id],params[:city_id],params[:data_date])
- .each do |x|
- percent_num = (x.average_score.floor.to_s.size > 1) ? x.average_score.floor.to_s[0]+'0' : "10"
- d << {
- latLng: [x.latitude.to_f, x.longitude.to_f],
- data: "<b>#{x.name_store}</b><br>#{x.address}<br>percentage: #{x.average_score}%",
- city_id: x.city_id,
- tag: ['marker',
- x.city.code,
- Customer.by_store(x.id).code,
- Area.by_store(x.id).code
- ],
- options: { icon: asset_path("percentages/21px-#{percent_num}p.png") }
- }
- end
- render json: d
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement