google ads account账号添加后默认控制绑定只能10个
This commit is contained in:
parent
13107526fe
commit
505eff067a
@ -69,7 +69,7 @@ class GoogleAdsCustomers
|
|||||||
// $customerId = $account['customer_id'];
|
// $customerId = $account['customer_id'];
|
||||||
// dump($customerId, $thirdUser->id, $rootAccountId, $account);
|
// dump($customerId, $thirdUser->id, $rootAccountId, $account);
|
||||||
// if($account['customer_id'] == 1509096882)continue;
|
// if($account['customer_id'] == 1509096882)continue;
|
||||||
$this->googleOAuthService->saveThirdUserAdvertiser($account['customer_id'], $thirdUser->id, $rootAccountId, $account,$thirdUser->merchant_id);
|
$this->googleOAuthService->saveThirdUserAdvertiser($account['customer_id'], $thirdUser->id, $rootAccountId, $account, $thirdUser->merchant_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->googleOAuthService->updateThirdUserDefault($thirdUser->id, 't');
|
$this->googleOAuthService->updateThirdUserDefault($thirdUser->id, 't');
|
||||||
@ -90,6 +90,9 @@ class GoogleAdsCustomers
|
|||||||
$option = [];
|
$option = [];
|
||||||
$option['refresh_token'] = $thirdUser->access_token;
|
$option['refresh_token'] = $thirdUser->access_token;
|
||||||
$listAccessibleCustomers = $this->googleAdsAccountService->runListAccessibleCustomers($option);
|
$listAccessibleCustomers = $this->googleAdsAccountService->runListAccessibleCustomers($option);
|
||||||
|
|
||||||
|
// Add a counter to limit the number of executions
|
||||||
|
$executionCount = 0;
|
||||||
foreach ($listAccessibleCustomers as $rootAccountId) {
|
foreach ($listAccessibleCustomers as $rootAccountId) {
|
||||||
$option['manager_customer_id'] = $rootAccountId; //开发者
|
$option['manager_customer_id'] = $rootAccountId; //开发者
|
||||||
$option['login_customer_id'] = $rootAccountId;
|
$option['login_customer_id'] = $rootAccountId;
|
||||||
@ -99,6 +102,12 @@ class GoogleAdsCustomers
|
|||||||
// dump($allAccountsByRoot,333);
|
// dump($allAccountsByRoot,333);
|
||||||
foreach ($allAccountsByRoot as $rootId => $accounts) {
|
foreach ($allAccountsByRoot as $rootId => $accounts) {
|
||||||
foreach ($accounts as $account) {
|
foreach ($accounts as $account) {
|
||||||
|
// Ensure we only execute 10 times
|
||||||
|
if ($executionCount >= 10) {
|
||||||
|
dump('Executed 10 times, stopping further calls.');
|
||||||
|
break 3; // Break out of both inner and outer loops
|
||||||
|
}
|
||||||
|
// dump($account);
|
||||||
$this->googleOAuthService->saveThirdUserAdvertiser(
|
$this->googleOAuthService->saveThirdUserAdvertiser(
|
||||||
$account['customer_id'],
|
$account['customer_id'],
|
||||||
$thirdUser->id,
|
$thirdUser->id,
|
||||||
@ -106,6 +115,8 @@ class GoogleAdsCustomers
|
|||||||
$account,
|
$account,
|
||||||
$thirdUser->merchant_id
|
$thirdUser->merchant_id
|
||||||
);
|
);
|
||||||
|
// Increment the counter
|
||||||
|
$executionCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 绑定的授权主体全部账号更新后将状态从 'f' 更新为 't'
|
// 绑定的授权主体全部账号更新后将状态从 'f' 更新为 't'
|
||||||
|
Loading…
Reference in New Issue
Block a user