From 55dd9dd5add3981abcd1eda347b00a7319124a4d Mon Sep 17 00:00:00 2001 From: huangguancheng Date: Sat, 18 Jan 2025 13:17:31 +0800 Subject: [PATCH] =?UTF-8?q?Google=20DateData=E5=A2=9E=E5=8A=A0=E5=B8=81?= =?UTF-8?q?=E7=A7=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/GoogleAdsCampaignService.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/service/GoogleAdsCampaignService.php b/app/service/GoogleAdsCampaignService.php index 06f1ff9..09d5e56 100644 --- a/app/service/GoogleAdsCampaignService.php +++ b/app/service/GoogleAdsCampaignService.php @@ -378,6 +378,7 @@ class GoogleAdsCampaignService extends BaseService ad_group.id, campaign.id, customer.id, + customer.currency_code, metrics.clicks, metrics.cost_micros, metrics.conversions, @@ -420,6 +421,7 @@ class GoogleAdsCampaignService extends BaseService /** @var GoogleAdsRow $googleAdsRow */ $resourceName['ad_id'] = $googleAdsRow->getAdGroupAd()->getAd()->getId(); $resourceName['customer_id'] = $googleAdsRow->getCustomer()->getId(); + $resourceName['currency'] = $googleAdsRow->getCustomer()->getCurrencyCode(); $resourceName['ad_name'] = $googleAdsRow->getAdGroupAd()->getAd()->getName(); $resourceName['ad_resource_name'] = $googleAdsRow->getAdGroupAd()->getAd()->getResourceName(); $resourceName['ad_group_id'] = $googleAdsRow->getAdGroup()->getId(); @@ -576,12 +578,12 @@ class GoogleAdsCampaignService extends BaseService // ThinkDb::execute($sql, $data); $sql = "INSERT INTO bps.bps_google_ad_day_data - (ad_id, customer_id, ad_name, ad_resource_name, ad_group_id, campaign_id, clicks, cost_micros, conversions, conversions_value, impressions, date, month, season, year,interactions, orders, revenue_micros, value_per_all_conversions, + (ad_id, customer_id,currency, ad_name, ad_resource_name, ad_group_id, campaign_id, clicks, cost_micros, conversions, conversions_value, impressions, date, month, season, year,interactions, orders, revenue_micros, value_per_all_conversions, value_per_all_conversions_by_conversion_date, value_per_conversion, value_per_conversions_by_conversion_date, video_quartile_p25_rate, video_quartile_p50_rate, video_quartile_p75_rate, video_quartile_p100_rate, video_view_rate, video_views, view_through_conversions) - VALUES (:ad_id, :customer_id, :ad_name, :ad_resource_name, :ad_group_id, :campaign_id, :clicks, :cost_micros, :conversions, :conversions_value, :impressions, :date, :month, :season, :year,:interactions, :orders, :revenue_micros, :value_per_all_conversions, + VALUES (:ad_id, :customer_id, :currency, :ad_name, :ad_resource_name, :ad_group_id, :campaign_id, :clicks, :cost_micros, :conversions, :conversions_value, :impressions, :date, :month, :season, :year,:interactions, :orders, :revenue_micros, :value_per_all_conversions, :value_per_all_conversions_by_conversion_date, :value_per_conversion, :value_per_conversions_by_conversion_date, :video_quartile_p25_rate, :video_quartile_p50_rate, :video_quartile_p75_rate, :video_quartile_p100_rate, @@ -589,6 +591,7 @@ class GoogleAdsCampaignService extends BaseService ON CONFLICT (ad_id, date) DO UPDATE SET customer_id = EXCLUDED.customer_id, + currency = EXCLUDED.currency, ad_name = EXCLUDED.ad_name, ad_resource_name = EXCLUDED.ad_resource_name, ad_group_id = EXCLUDED.ad_group_id,