Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Письменов Дмитрий Иванович
/
yourroomads
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8fd54f7a
authored
Dec 08, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Исправления
1 parent
295f4037
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
92 additions
and
38 deletions
app/Console/Commands/CampaignsAdd.php
app/Http/Controllers/CampaignVariablesController.php
app/Models/Pivots/DictionaryCampaign.php
app/Models/Tokens.php
app/Service/Requests/Direct/AddAdExtensions.php
app/Service/Requests/Direct/AddAdGroups.php
app/Service/Requests/Direct/AddAds.php
app/Service/Requests/Direct/AddBidModifiers.php
app/Service/Requests/Direct/AddKeywords.php
app/Service/Requests/Direct/AddRetargetinglists.php
app/Service/Requests/Direct/AddSitelinks.php
app/Service/Requests/Direct/ArchiveAds.php
app/Service/Requests/Direct/DeleteAdGroups.php
app/Service/Requests/Direct/DeleteAds.php
app/Service/Requests/Direct/DeleteAudienceTarget.php
app/Service/Requests/Direct/DeleteKeywords.php
app/Service/Requests/Direct/DeleteRetargetinglists.php
app/Service/Requests/Direct/DeleteVCards.php
app/Service/Requests/Direct/ResumeCampaigns.php
app/Service/Requests/Direct/SetBidModifiers.php
app/Service/Requests/Direct/SuspendCampaigns.php
app/Service/Requests/Direct/UpdateAdGroups.php
app/Service/Requests/Direct/UpdateAds.php
app/Service/Requests/Direct/UpdateKeywords.php
app/Service/Requests/Direct/UpdateRetargetinglists.php
app/Console/Commands/CampaignsAdd.php
View file @
8fd54f7
...
@@ -41,14 +41,14 @@ class CampaignsAdd extends Command
...
@@ -41,14 +41,14 @@ class CampaignsAdd extends Command
*/
*/
public
function
handle
()
public
function
handle
()
{
{
$tokens
=
Tokens
::
whereHas
(
'dictionaryCampaignsEnabledForNotExternalForNotReserveCreate'
)
$tokens
=
Tokens
::
whereHas
(
'dictionaryCampaignsEnabledForNotExternalForNotReserveCreate
Synchronized
'
)
->
with
(
'dictionaryCampaignsEnabledForNotExternalForNotReserveCreate.campaign'
)
->
with
(
'dictionaryCampaignsEnabledForNotExternalForNotReserveCreate
Synchronized
.campaign'
)
->
where
(
'type'
,
'!='
,
Tokens
::
MAIN
)
->
where
(
'type'
,
'!='
,
Tokens
::
MAIN
)
->
get
();
->
get
();
foreach
(
$tokens
as
$token
)
{
foreach
(
$tokens
as
$token
)
{
foreach
(
array_chunk
(
$token
->
dictionaryCampaignsEnabledForNotExternalForNotReserveCreate
->
pluck
(
'id'
)
->
toArray
(),
100
)
as
$items
)
{
foreach
(
array_chunk
(
$token
->
dictionaryCampaignsEnabledForNotExternalForNotReserveCreate
Synchronized
->
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
(),
...
@@ -58,7 +58,7 @@ class CampaignsAdd extends Command
...
@@ -58,7 +58,7 @@ class CampaignsAdd extends Command
$request
=
new
AddCampaigns
();
$request
=
new
AddCampaigns
();
$request
->
setToken
(
$token
)
$request
->
setToken
(
$token
)
->
call
([
->
call
([
'dictionaryCampaigns'
=>
$token
->
dictionaryCampaignsEnabledForNotExternalForNotReserveCreate
,
'dictionaryCampaigns'
=>
$token
->
dictionaryCampaignsEnabledForNotExternalForNotReserveCreate
Synchronized
,
]);
]);
}
}
...
...
app/Http/Controllers/CampaignVariablesController.php
View file @
8fd54f7
...
@@ -216,11 +216,11 @@ class CampaignVariablesController extends Controller
...
@@ -216,11 +216,11 @@ class CampaignVariablesController extends Controller
})
->
update
([
})
->
update
([
'updated_need'
=>
Carbon
::
now
(),
'updated_need'
=>
Carbon
::
now
(),
]);
]);
//
$dictionary_campaign->goalGoalSitelink()->forExternal()->where(function ($query) {
$dictionary_campaign
->
goalGoalSitelink
()
->
forExternal
()
->
where
(
function
(
$query
)
{
//
$query->getModel()->timestamps = false;
$query
->
getModel
()
->
timestamps
=
false
;
//
})->update([
})
->
update
([
//
'updated_need' => Carbon::now(),
'updated_need'
=>
Carbon
::
now
(),
//
]);
]);
$dictionary_campaign
->
goalVCards
()
->
forExternal
()
->
where
(
function
(
$query
)
{
$dictionary_campaign
->
goalVCards
()
->
forExternal
()
->
where
(
function
(
$query
)
{
$query
->
getModel
()
->
timestamps
=
false
;
$query
->
getModel
()
->
timestamps
=
false
;
})
->
update
([
})
->
update
([
...
...
app/Models/Pivots/DictionaryCampaign.php
View file @
8fd54f7
...
@@ -233,6 +233,8 @@ class DictionaryCampaign extends Pivot
...
@@ -233,6 +233,8 @@ class DictionaryCampaign extends Pivot
array_merge
(
array_merge
(
$data
,
$data
,
[
[
'updated'
=>
false
,
'synced'
=>
false
,
'dictionary_id'
=>
$dictionary
->
getKey
(),
'dictionary_id'
=>
$dictionary
->
getKey
(),
'campaign_id'
=>
$campaign
->
getKey
(),
'campaign_id'
=>
$campaign
->
getKey
(),
]
]
...
...
app/Models/Tokens.php
View file @
8fd54f7
...
@@ -234,9 +234,9 @@ class Tokens extends Model
...
@@ -234,9 +234,9 @@ class Tokens extends Model
return
$this
->
dictionaryCampaigns
()
->
enabled
()
->
forExternal
()
->
forUpdated
()
->
needUpdated
()
->
forNotReserveUpdate
();
return
$this
->
dictionaryCampaigns
()
->
enabled
()
->
forExternal
()
->
forUpdated
()
->
needUpdated
()
->
forNotReserveUpdate
();
}
}
public
function
dictionaryCampaignsEnabledForNotExternalForNotReserveCreate
()
public
function
dictionaryCampaignsEnabledForNotExternalForNotReserveCreate
Synchronized
()
{
{
return
$this
->
dictionaryCampaigns
()
->
enabled
()
->
forNotExternal
()
->
forNotReserveCreate
();
return
$this
->
dictionaryCampaigns
()
->
enabled
()
->
forNotExternal
()
->
forNotReserveCreate
()
->
synchronized
()
;
}
}
public
function
dictionaryCampaignsNotEnabledForExternalNotDisabledForNotReserveSuspend
()
public
function
dictionaryCampaignsNotEnabledForExternalNotDisabledForNotReserveSuspend
()
...
...
app/Service/Requests/Direct/AddAdExtensions.php
View file @
8fd54f7
...
@@ -97,11 +97,13 @@ class AddAdExtensions extends DirectRequest
...
@@ -97,11 +97,13 @@ class AddAdExtensions extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
GoalAdExtension
::
whereIn
(
'id'
,
$this
->
goalAdExtensions
->
pluck
(
'id'
)
->
toArray
())
foreach
(
array_chunk
(
$this
->
goalAdExtensions
->
pluck
(
'id'
)
->
toArray
(),
100
)
as
$items
)
{
GoalAdExtension
::
whereIn
(
'id'
,
$items
)
->
update
([
->
update
([
'reserve_create_at'
=>
null
,
'reserve_create_at'
=>
null
,
]);
]);
}
}
}
public
function
putParams
(
$params
)
public
function
putParams
(
$params
)
{
{
...
...
app/Service/Requests/Direct/AddAdGroups.php
View file @
8fd54f7
...
@@ -113,11 +113,13 @@ class AddAdGroups extends DirectRequest
...
@@ -113,11 +113,13 @@ class AddAdGroups extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
GoalAdGroup
::
whereIn
(
'id'
,
$this
->
goalAdGroups
->
pluck
(
'id'
)
->
toArray
())
foreach
(
array_chunk
(
$this
->
goalAdGroups
->
pluck
(
'id'
)
->
toArray
(),
100
)
as
$items
)
{
GoalAdGroup
::
whereIn
(
'id'
,
$items
)
->
update
([
->
update
([
'reserve_create_at'
=>
null
,
'reserve_create_at'
=>
null
,
]);
]);
}
}
}
public
function
putParams
(
$params
)
public
function
putParams
(
$params
)
{
{
...
...
app/Service/Requests/Direct/AddAds.php
View file @
8fd54f7
...
@@ -146,11 +146,13 @@ class AddAds extends DirectRequest
...
@@ -146,11 +146,13 @@ class AddAds extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
GoalAdvertisement
::
whereIn
(
'id'
,
$this
->
goalAds
->
pluck
(
'id'
)
->
toArray
())
foreach
(
array_chunk
(
$this
->
goalAds
->
pluck
(
'id'
)
->
toArray
(),
100
)
as
$items
)
{
GoalAdvertisement
::
whereIn
(
'id'
,
$items
)
->
update
([
->
update
([
'reserve_create_at'
=>
null
,
'reserve_create_at'
=>
null
,
]);
]);
}
}
}
public
function
putParams
(
$params
)
public
function
putParams
(
$params
)
{
{
...
...
app/Service/Requests/Direct/AddBidModifiers.php
View file @
8fd54f7
...
@@ -105,13 +105,15 @@ class AddBidModifiers extends DirectRequest
...
@@ -105,13 +105,15 @@ class AddBidModifiers extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
GoalBidModifier
::
whereIn
(
'id'
,
$this
->
goalBidModifiers
->
pluck
(
'ids'
)
->
map
(
function
(
$ids
)
{
foreach
(
array_chunk
(
$this
->
goalBidModifiers
->
pluck
(
'ids'
)
->
map
(
function
(
$ids
)
{
return
json_decode
(
$ids
);
return
json_decode
(
$ids
);
})
->
collapse
()
->
toArray
())
})
->
collapse
()
->
toArray
(),
100
)
as
$items
)
{
GoalBidModifier
::
whereIn
(
'id'
,
$items
)
->
update
([
->
update
([
'reserve_create_at'
=>
null
,
'reserve_create_at'
=>
null
,
]);
]);
}
}
}
public
function
putParams
(
$params
)
public
function
putParams
(
$params
)
{
{
...
...
app/Service/Requests/Direct/AddKeywords.php
View file @
8fd54f7
...
@@ -122,11 +122,13 @@ class AddKeywords extends DirectRequest
...
@@ -122,11 +122,13 @@ class AddKeywords extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
GoalKeyword
::
whereIn
(
'id'
,
$this
->
goalKeywords
->
pluck
(
'id'
)
->
toArray
())
foreach
(
array_chunk
(
$this
->
goalKeywords
->
pluck
(
'id'
)
->
toArray
(),
100
)
as
$items
)
{
GoalKeyword
::
whereIn
(
'id'
,
$items
)
->
update
([
->
update
([
'reserve_create_at'
=>
null
,
'reserve_create_at'
=>
null
,
]);
]);
}
}
}
private
function
requestPrepare
(
$params
)
private
function
requestPrepare
(
$params
)
{
{
...
...
app/Service/Requests/Direct/AddRetargetinglists.php
View file @
8fd54f7
...
@@ -101,11 +101,13 @@ class AddRetargetinglists extends DirectRequest
...
@@ -101,11 +101,13 @@ class AddRetargetinglists extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
GoalRetargetinglist
::
whereIn
(
'id'
,
$this
->
goalRetargetinglists
->
pluck
(
'id'
)
->
toArray
())
foreach
(
array_chunk
(
$this
->
goalRetargetinglists
->
pluck
(
'id'
)
->
toArray
(),
100
)
as
$items
)
{
GoalRetargetinglist
::
whereIn
(
'id'
,
$items
)
->
update
([
->
update
([
'reserve_create_at'
=>
null
,
'reserve_create_at'
=>
null
,
]);
]);
}
}
}
public
function
putParams
(
$params
)
public
function
putParams
(
$params
)
{
{
...
...
app/Service/Requests/Direct/AddSitelinks.php
View file @
8fd54f7
...
@@ -101,11 +101,13 @@ class AddSitelinks extends DirectRequest
...
@@ -101,11 +101,13 @@ class AddSitelinks extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
GoalSitelink
::
whereIn
(
'id'
,
$this
->
goalSitelinks
->
pluck
(
'id'
)
->
toArray
())
foreach
(
array_chunk
(
$this
->
goalSitelinks
->
pluck
(
'id'
)
->
toArray
(),
100
)
as
$items
)
{
GoalSitelink
::
whereIn
(
'id'
,
$items
)
->
update
([
->
update
([
'reserve_create_at'
=>
null
,
'reserve_create_at'
=>
null
,
]);
]);
}
}
}
public
function
putParams
(
$params
)
public
function
putParams
(
$params
)
{
{
...
...
app/Service/Requests/Direct/ArchiveAds.php
View file @
8fd54f7
...
@@ -132,17 +132,21 @@ class ArchiveAds extends DirectRequest
...
@@ -132,17 +132,21 @@ class ArchiveAds extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
if
(
$this
->
getToken
()
->
isMain
())
{
if
(
$this
->
getToken
()
->
isMain
())
{
Advertisement
::
whereIn
(
'external_id'
,
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
])
foreach
(
array_chunk
(
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
],
100
)
as
$items
)
{
Advertisement
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_archive_at'
=>
null
,
'reserve_archive_at'
=>
null
,
]);
]);
}
}
else
{
}
else
{
GoalAdvertisement
::
whereIn
(
'external_id'
,
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
])
foreach
(
array_chunk
(
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
],
100
)
as
$items
)
{
GoalAdvertisement
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_archive_at'
=>
null
,
'reserve_archive_at'
=>
null
,
]);
]);
}
}
}
}
}
private
function
requestPrepare
(
$params
)
private
function
requestPrepare
(
$params
)
{
{
...
...
app/Service/Requests/Direct/DeleteAdGroups.php
View file @
8fd54f7
...
@@ -82,11 +82,13 @@ class DeleteAdGroups extends DirectRequest
...
@@ -82,11 +82,13 @@ class DeleteAdGroups extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
GoalAdGroup
::
whereIn
(
'external_id'
,
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
])
foreach
(
array_chunk
(
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
],
100
)
as
$items
)
{
GoalAdGroup
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_delete_at'
=>
null
,
'reserve_delete_at'
=>
null
,
]);
]);
}
}
}
private
function
requestPrepare
(
$params
)
private
function
requestPrepare
(
$params
)
{
{
...
...
app/Service/Requests/Direct/DeleteAds.php
View file @
8fd54f7
...
@@ -114,17 +114,21 @@ class DeleteAds extends DirectRequest
...
@@ -114,17 +114,21 @@ class DeleteAds extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
if
(
$this
->
getToken
()
->
isMain
())
{
if
(
$this
->
getToken
()
->
isMain
())
{
Advertisement
::
whereIn
(
'external_id'
,
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
])
foreach
(
array_chunk
(
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
],
100
)
as
$items
)
{
Advertisement
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_delete_at'
=>
null
,
'reserve_delete_at'
=>
null
,
]);
]);
}
}
else
{
}
else
{
GoalAdvertisement
::
whereIn
(
'external_id'
,
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
])
foreach
(
array_chunk
(
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
],
100
)
as
$items
)
{
GoalAdvertisement
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_delete_at'
=>
null
,
'reserve_delete_at'
=>
null
,
]);
]);
}
}
}
}
}
private
function
requestPrepare
(
$params
)
private
function
requestPrepare
(
$params
)
{
{
...
...
app/Service/Requests/Direct/DeleteAudienceTarget.php
View file @
8fd54f7
...
@@ -99,17 +99,21 @@ class DeleteAudienceTarget extends DirectRequest
...
@@ -99,17 +99,21 @@ class DeleteAudienceTarget extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
if
(
$this
->
getToken
()
->
isMain
())
{
if
(
$this
->
getToken
()
->
isMain
())
{
AudienceTarget
::
whereIn
(
'external_id'
,
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
])
foreach
(
array_chunk
(
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
],
100
)
as
$items
)
{
AudienceTarget
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_delete_at'
=>
null
,
'reserve_delete_at'
=>
null
,
]);
]);
}
}
else
{
}
else
{
GoalAudienceTarget
::
whereIn
(
'external_id'
,
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
])
foreach
(
array_chunk
(
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
],
100
)
as
$items
)
{
GoalAudienceTarget
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_delete_at'
=>
null
,
'reserve_delete_at'
=>
null
,
]);
]);
}
}
}
}
}
private
function
requestPrepare
(
$params
)
private
function
requestPrepare
(
$params
)
{
{
...
...
app/Service/Requests/Direct/DeleteKeywords.php
View file @
8fd54f7
...
@@ -80,11 +80,13 @@ class DeleteKeywords extends DirectRequest
...
@@ -80,11 +80,13 @@ class DeleteKeywords extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
GoalKeyword
::
whereIn
(
'external_id'
,
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
])
foreach
(
array_chunk
(
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
],
100
)
as
$items
)
{
GoalKeyword
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_delete_at'
=>
null
,
'reserve_delete_at'
=>
null
,
]);
]);
}
}
}
private
function
requestPrepare
(
$params
)
private
function
requestPrepare
(
$params
)
{
{
...
...
app/Service/Requests/Direct/DeleteRetargetinglists.php
View file @
8fd54f7
...
@@ -99,17 +99,21 @@ class DeleteRetargetinglists extends DirectRequest
...
@@ -99,17 +99,21 @@ class DeleteRetargetinglists extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
if
(
$this
->
getToken
()
->
isMain
())
{
if
(
$this
->
getToken
()
->
isMain
())
{
Retargetinglist
::
whereIn
(
'external_id'
,
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
])
foreach
(
array_chunk
(
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
],
100
)
as
$items
)
{
Retargetinglist
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_delete_at'
=>
null
,
'reserve_delete_at'
=>
null
,
]);
]);
}
}
else
{
}
else
{
GoalRetargetinglist
::
whereIn
(
'external_id'
,
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
])
foreach
(
array_chunk
(
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
],
100
)
as
$items
)
{
GoalRetargetinglist
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_delete_at'
=>
null
,
'reserve_delete_at'
=>
null
,
]);
]);
}
}
}
}
}
private
function
requestPrepare
(
$params
)
private
function
requestPrepare
(
$params
)
{
{
...
...
app/Service/Requests/Direct/DeleteVCards.php
View file @
8fd54f7
...
@@ -111,17 +111,21 @@ class DeleteVCards extends DirectRequest
...
@@ -111,17 +111,21 @@ class DeleteVCards extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
if
(
$this
->
getToken
()
->
isMain
())
{
if
(
$this
->
getToken
()
->
isMain
())
{
VCard
::
whereIn
(
'external_id'
,
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
])
foreach
(
array_chunk
(
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
],
100
)
as
$items
)
{
VCard
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_delete_at'
=>
null
,
'reserve_delete_at'
=>
null
,
]);
]);
}
}
else
{
}
else
{
GoalVCard
::
whereIn
(
'external_id'
,
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
])
foreach
(
array_chunk
(
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
],
100
)
as
$items
)
{
GoalVCard
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_delete_at'
=>
null
,
'reserve_delete_at'
=>
null
,
]);
]);
}
}
}
}
}
private
function
requestPrepare
(
$params
)
private
function
requestPrepare
(
$params
)
{
{
...
...
app/Service/Requests/Direct/ResumeCampaigns.php
View file @
8fd54f7
...
@@ -76,11 +76,13 @@ class ResumeCampaigns extends DirectRequest
...
@@ -76,11 +76,13 @@ class ResumeCampaigns extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
DictionaryCampaign
::
whereIn
(
'external_id'
,
array_column
(
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
],
'Id'
))
foreach
(
array_chunk
(
array_column
(
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
],
'Id'
),
100
)
as
$items
)
{
DictionaryCampaign
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_resume_at'
=>
null
,
'reserve_resume_at'
=>
null
,
]);
]);
}
}
}
private
function
requestPrepare
(
$filter
)
private
function
requestPrepare
(
$filter
)
{
{
...
...
app/Service/Requests/Direct/SetBidModifiers.php
View file @
8fd54f7
...
@@ -91,11 +91,13 @@ class SetBidModifiers extends DirectRequest
...
@@ -91,11 +91,13 @@ class SetBidModifiers extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
GoalBidModifier
::
whereIn
(
'external_id'
,
array_column
(
$this
->
getParams
()[
'BidModifiers'
],
'Id'
))
foreach
(
array_chunk
(
array_column
(
$this
->
getParams
()[
'BidModifiers'
],
'Id'
),
100
)
as
$items
)
{
GoalBidModifier
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_update_at'
=>
null
,
'reserve_update_at'
=>
null
,
]);
]);
}
}
}
private
function
requestPrepare
(
$params
)
private
function
requestPrepare
(
$params
)
{
{
...
...
app/Service/Requests/Direct/SuspendCampaigns.php
View file @
8fd54f7
...
@@ -76,11 +76,13 @@ class SuspendCampaigns extends DirectRequest
...
@@ -76,11 +76,13 @@ class SuspendCampaigns extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
DictionaryCampaign
::
whereIn
(
'external_id'
,
array_column
(
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
],
'Id'
))
foreach
(
array_chunk
(
array_column
(
$this
->
getParams
()[
'SelectionCriteria'
][
'Ids'
],
'Id'
),
100
)
as
$items
)
{
DictionaryCampaign
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_suspend_at'
=>
null
,
'reserve_suspend_at'
=>
null
,
]);
]);
}
}
}
private
function
requestPrepare
(
$filter
)
private
function
requestPrepare
(
$filter
)
{
{
...
...
app/Service/Requests/Direct/UpdateAdGroups.php
View file @
8fd54f7
...
@@ -91,11 +91,13 @@ class UpdateAdGroups extends DirectRequest
...
@@ -91,11 +91,13 @@ class UpdateAdGroups extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
GoalAdGroup
::
whereIn
(
'external_id'
,
array_column
(
$this
->
getParams
()[
'AdGroups'
],
'Id'
))
foreach
(
array_chunk
(
array_column
(
$this
->
getParams
()[
'AdGroups'
],
'Id'
),
100
)
as
$items
)
{
GoalAdGroup
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_update_at'
=>
null
,
'reserve_update_at'
=>
null
,
]);
]);
}
}
}
private
function
requestPrepare
(
$params
)
private
function
requestPrepare
(
$params
)
{
{
...
...
app/Service/Requests/Direct/UpdateAds.php
View file @
8fd54f7
...
@@ -112,11 +112,13 @@ class UpdateAds extends DirectRequest
...
@@ -112,11 +112,13 @@ class UpdateAds extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
GoalAdvertisement
::
whereIn
(
'external_id'
,
array_column
(
$this
->
getParams
()[
'Ads'
],
'Id'
))
foreach
(
array_chunk
(
array_column
(
$this
->
getParams
()[
'Ads'
],
'Id'
),
100
)
as
$items
)
{
GoalAdvertisement
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_update_at'
=>
null
,
'reserve_update_at'
=>
null
,
]);
]);
}
}
}
private
function
requestPrepare
(
$params
)
private
function
requestPrepare
(
$params
)
{
{
...
...
app/Service/Requests/Direct/UpdateKeywords.php
View file @
8fd54f7
...
@@ -93,11 +93,13 @@ class UpdateKeywords extends DirectRequest
...
@@ -93,11 +93,13 @@ class UpdateKeywords extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
GoalKeyword
::
whereIn
(
'external_id'
,
array_column
(
$this
->
getParams
()[
'Keywords'
],
'Id'
))
foreach
(
array_chunk
(
array_column
(
$this
->
getParams
()[
'Keywords'
],
'Id'
),
100
)
as
$items
)
{
GoalKeyword
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_update_at'
=>
null
,
'reserve_update_at'
=>
null
,
]);
]);
}
}
}
private
function
requestPrepare
(
$params
)
private
function
requestPrepare
(
$params
)
{
{
...
...
app/Service/Requests/Direct/UpdateRetargetinglists.php
View file @
8fd54f7
...
@@ -88,11 +88,13 @@ class UpdateRetargetinglists extends DirectRequest
...
@@ -88,11 +88,13 @@ class UpdateRetargetinglists extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
GoalRetargetinglist
::
whereIn
(
'external_id'
,
array_column
(
$this
->
getParams
()[
'RetargetingLists'
],
'Id'
))
foreach
(
array_chunk
(
array_column
(
$this
->
getParams
()[
'RetargetingLists'
],
'Id'
),
100
)
as
$items
)
{
GoalRetargetinglist
::
whereIn
(
'external_id'
,
$items
)
->
update
([
->
update
([
'reserve_update_at'
=>
null
,
'reserve_update_at'
=>
null
,
]);
]);
}
}
}
private
function
requestPrepare
(
$params
)
private
function
requestPrepare
(
$params
)
{
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment