update commission && report
This commit is contained in:
@@ -61,9 +61,10 @@ class ProductCommission < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.get_transaction(from, to, commissioner)
|
||||
transaction = all
|
||||
transaction = ProductCommission.select("product_commissions.*,menu_items.name as porduct_name")
|
||||
.joins("join menu_items on menu_items.item_code = product_commissions.product_code")
|
||||
if !from.nil? && !to.nil?
|
||||
transaction = transaction.where('updated_at between ? and ?', from, to)
|
||||
transaction = transaction.where('product_commissions.updated_at between ? and ?', from, to)
|
||||
end
|
||||
if commissioner != 0
|
||||
transaction = transaction.where(commissioner_id: commissioner)
|
||||
|
||||
Reference in New Issue
Block a user