Created
August 1, 2014 21:47
-
-
Save DanBradbury/3f4d35509fe3b33f792b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ac = ActiveRecord::Base.connection.execute("SELECT advertiser_id, id_from_network, name FROM advertiser_campaigns WHERE advertiser_id=1 ").first | |
ad = ActiveRecord::Base.connection.execute("SELECT id_from_network, name FROM advertisers WHERE id=#{ac[0]}").first | |
affiliate_id = 1 | |
af = ActiveRecord::Base.connection.execute("SELECT id_from_network, name, commissions_ranking,call_volume_ranking, conversion_rate_ranking FROM affiliates WHERE id=#{affiliate_id}").first | |
dnpr_id = DynamicNumberPoolReferrer.last.id | |
dnpr = ActiveRecord::Base.connection.execute("SELECT r.dynamic_number_pool_id, r.search_engine, r.search_keywords, r.param1_value, r.param2_value, r.param3_value, r.param4_value, r.param5_value, r.param6_value, r.param7_value, r.param8_value, r.param9_value, r.param10_value, d.pool_type, d.param1, d.param2, d.param3, d.param4, d.param5, d.param6, d.param7, d.param8, d.param9, d.param10 FROM dynamic_number_pool_referrers AS r JOIN dynamic_number_pools AS d ON(r.dynamic_number_pool_id=d.id) WHERE r.id=#{dnpr_id}").first | |
dnp_id = dnpr[0] | |
ActiveRecord::Base.connection.execute("SELECT pool_type, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10 FROM dynamic_number_pools WHERE id=#{dnp_id}").first | |
ActiveRecord::Base.connection.execute("SELECT t.advertiser_id, t.id_from_network, t.name, b.id_from_network, b.name FROM advertiser_campaigns AS t JOIN advertisers AS b ON(t.advertiser_id=b.id) WHERE advertiser_id=1 ") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment