mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-26 20:54:21 +01:00
(bug) fix generate statistics
This commit is contained in:
parent
6e97336005
commit
1b21453adc
@ -126,9 +126,7 @@ class StatisticService
|
|||||||
|
|
||||||
def subscriptions_list(options = default_options)
|
def subscriptions_list(options = default_options)
|
||||||
result = []
|
result = []
|
||||||
join_clause = "INNER JOIN suscriptions ON invoice_items.object_id = suscriptions.id AND invoice_items.object_type = '#{Subscription.name}'"
|
InvoiceItem.where("object_type = '#{Subscription.name}' AND invoice_items.created_at >= :start_date AND invoice_items.created_at <= :end_date", options)
|
||||||
InvoiceItem.joins(join_clause)
|
|
||||||
.where("object_type = #{Subscription.name} invoice_items.created_at >= :start_date AND invoice_items.created_at <= :end_date", options)
|
|
||||||
.eager_load(invoice: [:coupon]).each do |i|
|
.eager_load(invoice: [:coupon]).each do |i|
|
||||||
next if i.invoice.is_a?(Avoir)
|
next if i.invoice.is_a?(Avoir)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user