From 9f5cd5a1f14fee469c18a59de0ff7391d2d4be7b Mon Sep 17 00:00:00 2001 From: huangguancheng Date: Tue, 21 Jan 2025 16:16:29 +0800 Subject: [PATCH] =?UTF-8?q?google=E5=B9=BF=E5=91=8A=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=8C=E6=AD=A5=E5=B8=81=E7=A7=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/event/GoogleAdsCustomers.php | 2 +- app/service/GoogleAdsAccountService.php | 1 + app/service/GoogleOAuthService.php | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/event/GoogleAdsCustomers.php b/app/event/GoogleAdsCustomers.php index 0f22c61..a788e21 100644 --- a/app/event/GoogleAdsCustomers.php +++ b/app/event/GoogleAdsCustomers.php @@ -96,7 +96,7 @@ class GoogleAdsCustomers try { // 获取当前 rootAccountId 的所有账户 $allAccountsByRoot = $this->googleAdsAccountService->runGetAccountHierarchy($option); - dump($allAccountsByRoot,333); +// dump($allAccountsByRoot,333); foreach ($allAccountsByRoot as $rootId => $accounts) { foreach ($accounts as $account) { $this->googleOAuthService->saveThirdUserAdvertiser( diff --git a/app/service/GoogleAdsAccountService.php b/app/service/GoogleAdsAccountService.php index 95f6e70..3c53188 100644 --- a/app/service/GoogleAdsAccountService.php +++ b/app/service/GoogleAdsAccountService.php @@ -740,6 +740,7 @@ class GoogleAdsAccountService extends BaseService 'descriptive_name' => $customerClient->getDescriptiveName(), 'manager' => $customerClient->getManager(), 'test_account' => $customerClient->getTestAccount(), + 'currency' => $customerClient->getCurrencyCode(), ]; // Recursively call this function for all child accounts of $customerClient. diff --git a/app/service/GoogleOAuthService.php b/app/service/GoogleOAuthService.php index 456c1be..9408654 100644 --- a/app/service/GoogleOAuthService.php +++ b/app/service/GoogleOAuthService.php @@ -104,6 +104,7 @@ class GoogleOAuthService 'advertiser_name' => $customer['descriptive_name'], 'google_login_customer_id' => $login_customer_id, 'merchant_id' => $merchant_id, + 'currency' => $customer['currency'], ]; if ($customer['manager'] === true) { $data['google_manager'] = 't'; @@ -118,14 +119,15 @@ class GoogleOAuthService // dump($data); $sql = " INSERT INTO {$tableName} - (advertiser_id,advertiser_name, doc_,google_login_customer_id,google_manager,google_test_account,merchant_id) - VALUES (:advertiser_id, :advertiser_name,:doc_,:google_login_customer_id,:google_manager,:google_test_account,:merchant_id) + (advertiser_id,advertiser_name, doc_,google_login_customer_id,google_manager,google_test_account,merchant_id,currency) + VALUES (:advertiser_id, :advertiser_name,:doc_,:google_login_customer_id,:google_manager,:google_test_account,:merchant_id,:currency) ON CONFLICT (advertiser_id,doc_) DO UPDATE SET advertiser_name = EXCLUDED.advertiser_name, google_login_customer_id = EXCLUDED.google_login_customer_id, google_manager = EXCLUDED.google_manager, google_test_account = EXCLUDED.google_test_account, + currency = EXCLUDED.currency, merchant_id = EXCLUDED.merchant_id "; // dump($sql,$data);