Skip to content

Instantly share code, notes, and snippets.

@mlooney
Created July 2, 2009 15:12
Show Gist options
  • Save mlooney/139515 to your computer and use it in GitHub Desktop.
Save mlooney/139515 to your computer and use it in GitHub Desktop.
def mgr_sum_for_affiliate_for_month(affiliate, m=Date.today)
ImporterData.count_by_sql(['select sum(field_number_value) from importer_datas where (field_name = ? and poker_room_id=? and member_id=?) and (created_at < ? and created_at > ?)', 'MGR', affiliate.id, self.id, m.end_of_month, m.beginning_of_month])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment