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);