Commit 96a0c598 by Vladislav

#21467 Удаление ретаргетинга компаний

1 parent 3884f673
...@@ -57,7 +57,7 @@ class AdExtensionsAdd extends Command ...@@ -57,7 +57,7 @@ class AdExtensionsAdd extends Command
$goalAdExtensions = $token->goalAdExtensionsForNotExternalForNotReserveCreate; $goalAdExtensions = $token->goalAdExtensionsForNotExternalForNotReserveCreate;
foreach (array_chunk($goalAdExtensions->pluck('id')->toArray(), 1000) as $items) { foreach (array_chunk($goalAdExtensions->pluck('id')->toArray(), 100) as $items) {
GoalAdExtension::whereIn('id', $items) GoalAdExtension::whereIn('id', $items)
->update([ ->update([
'reserve_create_at' => Carbon::now(), 'reserve_create_at' => Carbon::now(),
......
...@@ -63,7 +63,7 @@ class AdGroupsAdd extends Command ...@@ -63,7 +63,7 @@ class AdGroupsAdd extends Command
$goalAdGroups = $token->dictionaryCampaignsEnabledForExternalSynchronized->pluck('groupsForNotExternalForNotReserveCreate') $goalAdGroups = $token->dictionaryCampaignsEnabledForExternalSynchronized->pluck('groupsForNotExternalForNotReserveCreate')
->collapse(); ->collapse();
foreach (array_chunk($goalAdGroups->pluck('id')->toArray(), 1000) as $items) { foreach (array_chunk($goalAdGroups->pluck('id')->toArray(), 100) as $items) {
GoalAdGroup::whereIn('id', $items) GoalAdGroup::whereIn('id', $items)
->update([ ->update([
'reserve_create_at' => Carbon::now(), 'reserve_create_at' => Carbon::now(),
......
...@@ -80,7 +80,7 @@ class AdGroupsDelete extends Command ...@@ -80,7 +80,7 @@ class AdGroupsDelete extends Command
continue; continue;
} }
foreach (array_chunk($ids, 1000) as $items) { foreach (array_chunk($ids, 100) as $items) {
GoalAdGroup::whereIn('external_id', $items) GoalAdGroup::whereIn('external_id', $items)
->update([ ->update([
'reserve_delete_at' => Carbon::now(), 'reserve_delete_at' => Carbon::now(),
......
...@@ -60,7 +60,7 @@ class AdGroupsLoadKeywords extends Command ...@@ -60,7 +60,7 @@ class AdGroupsLoadKeywords extends Command
->pluck('external_id') ->pluck('external_id')
->toArray(); ->toArray();
foreach (array_chunk($ad_group_ids, 1000) as $ids_limit) { foreach (array_chunk($ad_group_ids, 100) as $ids_limit) {
$request = new GetKeywords(); $request = new GetKeywords();
$request->setToken($token) $request->setToken($token)
->call([ ->call([
......
...@@ -59,7 +59,7 @@ class AdGroupsUpdate extends Command ...@@ -59,7 +59,7 @@ class AdGroupsUpdate extends Command
$goalAdGroups = $token->dictionaryCampaignsEnabledForExternalUpdated->pluck('groupsForExternalForNeedUpdatedForNotReserveUpdate') $goalAdGroups = $token->dictionaryCampaignsEnabledForExternalUpdated->pluck('groupsForExternalForNeedUpdatedForNotReserveUpdate')
->collapse(); ->collapse();
foreach (array_chunk($goalAdGroups->pluck('id')->toArray(), 1000) as $items){ foreach (array_chunk($goalAdGroups->pluck('id')->toArray(), 100) as $items){
GoalAdGroup::whereIn('id', $items) GoalAdGroup::whereIn('id', $items)
->update([ ->update([
'reserve_update_at' => Carbon::now(), 'reserve_update_at' => Carbon::now(),
......
...@@ -57,7 +57,7 @@ class AdImagesAdd extends Command ...@@ -57,7 +57,7 @@ class AdImagesAdd extends Command
$goalAdImages = $token->goalAdImagesForNotExternalForNotReserveCreate; $goalAdImages = $token->goalAdImagesForNotExternalForNotReserveCreate;
foreach (array_chunk($goalAdImages->pluck('id')->toArray(), 1000) as $items) { foreach (array_chunk($goalAdImages->pluck('id')->toArray(), 100) as $items) {
GoalAdImage::whereIn('id', $items) GoalAdImage::whereIn('id', $items)
->update([ ->update([
'reserve_create_at' => Carbon::now(), 'reserve_create_at' => Carbon::now(),
......
...@@ -113,7 +113,7 @@ class AdvertisementsAdd extends Command ...@@ -113,7 +113,7 @@ class AdvertisementsAdd extends Command
continue; continue;
} }
foreach (array_chunk($goalAds->pluck('id')->toArray(), 1000) as $items) { foreach (array_chunk($goalAds->pluck('id')->toArray(), 100) as $items) {
GoalAdvertisement::whereIn('id', $items) GoalAdvertisement::whereIn('id', $items)
->update([ ->update([
'reserve_create_at' => Carbon::now(), 'reserve_create_at' => Carbon::now(),
......
...@@ -66,7 +66,7 @@ class AdvertisementsArchive extends Command ...@@ -66,7 +66,7 @@ class AdvertisementsArchive extends Command
return; return;
} }
foreach (array_chunk($ads->pluck('external_id')->toArray(), 1000) as $items) { foreach (array_chunk($ads->pluck('external_id')->toArray(), 100) as $items) {
if ($token->isMain()) { if ($token->isMain()) {
Advertisement::whereIn('external_id', $items) Advertisement::whereIn('external_id', $items)
->update([ ->update([
......
...@@ -62,7 +62,7 @@ class AdvertisementsDelete extends Command ...@@ -62,7 +62,7 @@ class AdvertisementsDelete extends Command
$ids = $ads->pluck('external_id')->toArray(); $ids = $ads->pluck('external_id')->toArray();
foreach (array_chunk($ids, 1000) as $items) { foreach (array_chunk($ids, 100) as $items) {
if ($token->isMain()) { if ($token->isMain()) {
Advertisement::whereIn('external_id', $items) Advertisement::whereIn('external_id', $items)
->update([ ->update([
......
...@@ -111,7 +111,7 @@ class AdvertisementsUpdate extends Command ...@@ -111,7 +111,7 @@ class AdvertisementsUpdate extends Command
continue; continue;
} }
foreach (array_chunk($goalAds->pluck('external_id')->toArray(), 1000) as $items) { foreach (array_chunk($goalAds->pluck('external_id')->toArray(), 100) as $items) {
GoalAdvertisement::whereIn('external_id', $items) GoalAdvertisement::whereIn('external_id', $items)
->update([ ->update([
'reserve_update_at' => Carbon::now(), 'reserve_update_at' => Carbon::now(),
......
...@@ -58,7 +58,7 @@ class AudienceTargetsAdd extends Command ...@@ -58,7 +58,7 @@ class AudienceTargetsAdd extends Command
$goalAudienceTargets = $token->dictionaryCampaignsEnabledForExternalSynchronized->pluck('goalAudienceTargetsForNotExternalForNotReserveCreate') $goalAudienceTargets = $token->dictionaryCampaignsEnabledForExternalSynchronized->pluck('goalAudienceTargetsForNotExternalForNotReserveCreate')
->collapse(); ->collapse();
foreach (array_chunk($goalAudienceTargets->pluck('id')->toArray(), 1000) as $items) { foreach (array_chunk($goalAudienceTargets->pluck('id')->toArray(), 100) as $items) {
GoalAudienceTarget::whereIn('id', $items) GoalAudienceTarget::whereIn('id', $items)
->update([ ->update([
'reserve_create_at' => Carbon::now(), 'reserve_create_at' => Carbon::now(),
......
...@@ -58,7 +58,7 @@ class AudienceTargetsDelete extends Command ...@@ -58,7 +58,7 @@ class AudienceTargetsDelete extends Command
$ids = $goalAudienceTargets->pluck('external_id')->toArray(); $ids = $goalAudienceTargets->pluck('external_id')->toArray();
foreach (array_chunk($ids, 1000) as $items) { foreach (array_chunk($ids, 100) as $items) {
GoalAudienceTarget::whereIn('external_id', $items) GoalAudienceTarget::whereIn('external_id', $items)
->update([ ->update([
'reserve_delete_at' => Carbon::now(), 'reserve_delete_at' => Carbon::now(),
......
...@@ -151,7 +151,7 @@ class BidModifiersAdd extends Command ...@@ -151,7 +151,7 @@ class BidModifiersAdd extends Command
foreach (array_chunk($goalBidModifiers->pluck('ids')->map(function ($ids) { foreach (array_chunk($goalBidModifiers->pluck('ids')->map(function ($ids) {
return json_decode($ids); return json_decode($ids);
})->collapse()->toArray(), 1000) as $items) { })->collapse()->toArray(), 100) as $items) {
GoalBidModifier::whereIn('id', $items) GoalBidModifier::whereIn('id', $items)
->update([ ->update([
'reserve_create_at' => Carbon::now(), 'reserve_create_at' => Carbon::now(),
......
...@@ -70,7 +70,7 @@ class BidModifiersUpdate extends Command ...@@ -70,7 +70,7 @@ class BidModifiersUpdate extends Command
continue; continue;
} }
foreach (array_chunk($goalBidModifiers->pluck('external_id')->toArray(), 1000) as $items) { foreach (array_chunk($goalBidModifiers->pluck('external_id')->toArray(), 100) as $items) {
GoalBidModifier::whereIn('external_id', $items) GoalBidModifier::whereIn('external_id', $items)
->update([ ->update([
'reserve_update_at' => Carbon::now(), 'reserve_update_at' => Carbon::now(),
......
...@@ -48,7 +48,7 @@ class CampaignsAdd extends Command ...@@ -48,7 +48,7 @@ class CampaignsAdd extends Command
foreach ($tokens as $token) { foreach ($tokens as $token) {
foreach (array_chunk($token->dictionaryCampaignsEnabledForNotExternalForNotReserveCreate->pluck('id')->toArray(), 1000) as $items) { foreach (array_chunk($token->dictionaryCampaignsEnabledForNotExternalForNotReserveCreate->pluck('id')->toArray(), 100) as $items) {
DictionaryCampaign::whereIn('id', $items) DictionaryCampaign::whereIn('id', $items)
->update([ ->update([
'reserve_create_at' => Carbon::now(), 'reserve_create_at' => Carbon::now(),
......
...@@ -63,7 +63,7 @@ class CampaignsResume extends Command ...@@ -63,7 +63,7 @@ class CampaignsResume extends Command
->get(); ->get();
foreach ($tokens as $token) { foreach ($tokens as $token) {
foreach (array_chunk($token->dictionaryCampaignsEnabledForExternalDisabledForNotReserveResume->pluck('id')->toArray(), 1000) as $items) { foreach (array_chunk($token->dictionaryCampaignsEnabledForExternalDisabledForNotReserveResume->pluck('id')->toArray(), 100) as $items) {
DictionaryCampaign::whereIn('id', $items) DictionaryCampaign::whereIn('id', $items)
->update([ ->update([
'reserve_resume_at' => Carbon::now(), 'reserve_resume_at' => Carbon::now(),
......
...@@ -61,7 +61,7 @@ class CampaignsSuspend extends Command ...@@ -61,7 +61,7 @@ class CampaignsSuspend extends Command
->get(); ->get();
foreach ($tokens as $token) { foreach ($tokens as $token) {
foreach (array_chunk($token->dictionaryCampaignsNotEnabledForExternalNotDisabledForNotReserveSuspend->pluck('id')->toArray(), 1000) as $items) { foreach (array_chunk($token->dictionaryCampaignsNotEnabledForExternalNotDisabledForNotReserveSuspend->pluck('id')->toArray(), 100) as $items) {
DictionaryCampaign::whereIn('id', $items) DictionaryCampaign::whereIn('id', $items)
->update([ ->update([
'reserve_suspend_at' => Carbon::now(), 'reserve_suspend_at' => Carbon::now(),
......
...@@ -47,7 +47,7 @@ class CampaignsUpdate extends Command ...@@ -47,7 +47,7 @@ class CampaignsUpdate extends Command
->get(); ->get();
foreach ($tokens as $token) { foreach ($tokens as $token) {
foreach (array_chunk($token->dictionaryCampaignsEnabledForExternalUpdatedNeedUpdatedForNotReserveUpdate->pluck('id')->toArray(), 1000) as $items) { foreach (array_chunk($token->dictionaryCampaignsEnabledForExternalUpdatedNeedUpdatedForNotReserveUpdate->pluck('id')->toArray(), 100) as $items) {
DictionaryCampaign::whereIn('id', $items) DictionaryCampaign::whereIn('id', $items)
->update([ ->update([
'reserve_update_at' => Carbon::now(), 'reserve_update_at' => Carbon::now(),
......
...@@ -77,7 +77,7 @@ class KeywordsAdd extends Command ...@@ -77,7 +77,7 @@ class KeywordsAdd extends Command
if ($goalKeywords->count()) { if ($goalKeywords->count()) {
foreach (array_chunk($goalKeywords->pluck('id')->toArray(), 1000) as $items) { foreach (array_chunk($goalKeywords->pluck('id')->toArray(), 100) as $items) {
GoalKeyword::whereIn('id', $items) GoalKeyword::whereIn('id', $items)
->update([ ->update([
'reserve_create_at' => Carbon::now(), 'reserve_create_at' => Carbon::now(),
......
...@@ -77,7 +77,7 @@ class KeywordsDelete extends Command ...@@ -77,7 +77,7 @@ class KeywordsDelete extends Command
continue; continue;
} }
foreach (array_chunk($ids, 1000) as $items) { foreach (array_chunk($ids, 100) as $items) {
GoalKeyword::whereIn('external_id', $items) GoalKeyword::whereIn('external_id', $items)
->update([ ->update([
'reserve_delete_at' => Carbon::now(), 'reserve_delete_at' => Carbon::now(),
......
...@@ -59,7 +59,7 @@ class KeywordsUpdate extends Command ...@@ -59,7 +59,7 @@ class KeywordsUpdate extends Command
continue; continue;
} }
foreach (array_chunk($goalKeywords->pluck('id')->toArray(), 1000) as $items) { foreach (array_chunk($goalKeywords->pluck('id')->toArray(), 100) as $items) {
GoalKeyword::whereIn('id', $items) GoalKeyword::whereIn('id', $items)
->update([ ->update([
'reserve_update_at' => Carbon::now(), 'reserve_update_at' => Carbon::now(),
......
...@@ -57,7 +57,7 @@ class NegativeKeywordSharedSetsAdd extends Command ...@@ -57,7 +57,7 @@ class NegativeKeywordSharedSetsAdd extends Command
$goalNegativeKeywordSharedSets = $token->goalNegativeKeywordSharedSetsForNotExternalForNotReserveCreate; $goalNegativeKeywordSharedSets = $token->goalNegativeKeywordSharedSetsForNotExternalForNotReserveCreate;
foreach (array_chunk($goalNegativeKeywordSharedSets->pluck('id')->toArray(), 1000) as $items) { foreach (array_chunk($goalNegativeKeywordSharedSets->pluck('id')->toArray(), 100) as $items) {
GoalNegativeKeywordSharedSet::whereIn('id', $items) GoalNegativeKeywordSharedSet::whereIn('id', $items)
->update([ ->update([
'reserve_create_at' => Carbon::now(), 'reserve_create_at' => Carbon::now(),
......
...@@ -58,7 +58,7 @@ class NegativeKeywordSharedSetsUpdate extends Command ...@@ -58,7 +58,7 @@ class NegativeKeywordSharedSetsUpdate extends Command
$goalNegativeKeywordSharedSets = $token->goalNegativeKeywordSharedSetsForExternalForNotReserveUpdateNeedUpdated; $goalNegativeKeywordSharedSets = $token->goalNegativeKeywordSharedSetsForExternalForNotReserveUpdateNeedUpdated;
foreach (array_chunk($goalNegativeKeywordSharedSets->pluck('id')->toArray(), 1000) as $items) { foreach (array_chunk($goalNegativeKeywordSharedSets->pluck('id')->toArray(), 100) as $items) {
GoalNegativeKeywordSharedSet::whereIn('id', $items) GoalNegativeKeywordSharedSet::whereIn('id', $items)
->update([ ->update([
'reserve_update_at' => Carbon::now(), 'reserve_update_at' => Carbon::now(),
......
...@@ -57,7 +57,7 @@ class RetargetinglistsAdd extends Command ...@@ -57,7 +57,7 @@ class RetargetinglistsAdd extends Command
$goalRetargetinglists = $token->goalRetargetinglistsForNotExternalForNotReserveCreate; $goalRetargetinglists = $token->goalRetargetinglistsForNotExternalForNotReserveCreate;
foreach (array_chunk($goalRetargetinglists->pluck('id')->toArray(), 1000) as $items) { foreach (array_chunk($goalRetargetinglists->pluck('id')->toArray(), 100) as $items) {
GoalRetargetinglist::whereIn('id', $items) GoalRetargetinglist::whereIn('id', $items)
->update([ ->update([
'reserve_create_at' => Carbon::now(), 'reserve_create_at' => Carbon::now(),
......
...@@ -54,7 +54,7 @@ class RetargetinglistsDelete extends Command ...@@ -54,7 +54,7 @@ class RetargetinglistsDelete extends Command
$goalRetargetinglists = $token->goalRetargetinglistsForExternalNeedDeletedForNotReserveDelete; $goalRetargetinglists = $token->goalRetargetinglistsForExternalNeedDeletedForNotReserveDelete;
foreach (array_chunk($goalRetargetinglists->pluck('id')->toArray(), 1000) as $items) { foreach (array_chunk($goalRetargetinglists->pluck('id')->toArray(), 100) as $items) {
GoalRetargetinglist::whereIn('id', $items) GoalRetargetinglist::whereIn('id', $items)
->update([ ->update([
'reserve_delete_at' => Carbon::now(), 'reserve_delete_at' => Carbon::now(),
......
...@@ -57,7 +57,7 @@ class RetargetinglistsUpdate extends Command ...@@ -57,7 +57,7 @@ class RetargetinglistsUpdate extends Command
$goalRetargetinglists = $token->goalRetargetinglistsForExternalForNotReserveUpdateNeedUpdated; $goalRetargetinglists = $token->goalRetargetinglistsForExternalForNotReserveUpdateNeedUpdated;
foreach (array_chunk($goalRetargetinglists->pluck('id')->toArray(), 1000) as $items) { foreach (array_chunk($goalRetargetinglists->pluck('id')->toArray(), 100) as $items) {
GoalRetargetinglist::whereIn('id', $items) GoalRetargetinglist::whereIn('id', $items)
->update([ ->update([
'reserve_update_at' => Carbon::now(), 'reserve_update_at' => Carbon::now(),
......
...@@ -58,7 +58,7 @@ class SitelinksAdd extends Command ...@@ -58,7 +58,7 @@ class SitelinksAdd extends Command
$goalSitelinks = $token->goalSitelinksForNotExternalForNotReserveCreate; $goalSitelinks = $token->goalSitelinksForNotExternalForNotReserveCreate;
// foreach (array_chunk($goalSitelinks->pluck('id')->toArray(), 1000) as $items) { // foreach (array_chunk($goalSitelinks->pluck('id')->toArray(), 100) as $items) {
// GoalSitelink::whereIn('id', $items) // GoalSitelink::whereIn('id', $items)
// ->update([ // ->update([
// 'reserve_create_at' => Carbon::now(), // 'reserve_create_at' => Carbon::now(),
......
...@@ -58,7 +58,7 @@ class VCardsAdd extends Command ...@@ -58,7 +58,7 @@ class VCardsAdd extends Command
$goalVCards = $token->dictionaryCampaignsEnabledForExternalSynchronized->pluck('goalVCardsForNotExternalForNotReserveCreate') $goalVCards = $token->dictionaryCampaignsEnabledForExternalSynchronized->pluck('goalVCardsForNotExternalForNotReserveCreate')
->collapse(); ->collapse();
foreach (array_chunk($goalVCards->pluck('id')->toArray(), 1000) as $items) { foreach (array_chunk($goalVCards->pluck('id')->toArray(), 100) as $items) {
GoalVCard::whereIn('id', $items) GoalVCard::whereIn('id', $items)
->update([ ->update([
'reserve_create_at' => Carbon::now(), 'reserve_create_at' => Carbon::now(),
......
...@@ -65,7 +65,7 @@ class VCardsDelete extends Command ...@@ -65,7 +65,7 @@ class VCardsDelete extends Command
return; return;
} }
foreach (array_chunk($vCards->pluck('external_id')->toArray(), 1000) as $items) { foreach (array_chunk($vCards->pluck('external_id')->toArray(), 100) as $items) {
if ($token->isMain()) { if ($token->isMain()) {
VCard::whereIn('external_id', $items) VCard::whereIn('external_id', $items)
->update([ ->update([
......
...@@ -7,6 +7,7 @@ use App\Models\Retargetinglist; ...@@ -7,6 +7,7 @@ use App\Models\Retargetinglist;
use App\Service\Contract\APIRequest; use App\Service\Contract\APIRequest;
use App\Service\Requests\DirectRequest; use App\Service\Requests\DirectRequest;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Support\Facades\DB;
class GetRetargetinglists extends DirectRequest class GetRetargetinglists extends DirectRequest
{ {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!