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 8018cc8b
authored
Aug 25, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#20794 Сделать чтобы в целевых РК оставалась одна карточка
1 parent
308b29b7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
app/Service/Requests/Direct/UpdateAds.php
app/Service/Requests/Direct/UpdateCampaigns.php
app/Service/Requests/Direct/UpdateAds.php
View file @
8018cc8
...
...
@@ -44,6 +44,13 @@ class UpdateAds extends DirectRequest
foreach
(
$response
[
'result'
][
'UpdateResults'
]
as
$key
=>
$update_result
)
{
if
(
!
isset
(
$update_result
[
'Id'
]))
{
if
(
isset
(
$update_result
[
'Errors'
][
0
][
'Details'
])
&&
$update_result
[
'Errors'
][
0
][
'Details'
]
===
'You cannot update an archived ad'
)
{
GoalAdvertisement
::
whereExternalId
(
$this
->
getParams
()[
'Ads'
][
$key
][
'Id'
])
->
forceDelete
();
continue
;
}
Log
::
debug
(
"UpdateAds, empty Id"
);
Log
::
debug
(
$update_result
);
Log
::
debug
(
$this
->
getParams
()[
'Ads'
][
$key
]);
...
...
app/Service/Requests/Direct/UpdateCampaigns.php
View file @
8018cc8
...
...
@@ -45,6 +45,13 @@ class UpdateCampaigns extends DirectRequest
foreach
(
$response
[
'result'
][
'UpdateResults'
]
as
$key
=>
$add_result
)
{
if
(
!
isset
(
$add_result
[
'Id'
]))
{
if
(
isset
(
$add_result
[
'Errors'
][
0
][
'Details'
])
&&
$add_result
[
'Errors'
][
0
][
'Details'
]
===
'It is forbidden to change an archived campaign'
)
{
DictionaryCampaign
::
whereExternalId
(
$this
->
getParams
()[
'Campaigns'
][
$key
][
'Id'
])
->
forceDelete
();
continue
;
}
Log
::
debug
(
"UpdateCampaigns, empty Id"
);
Log
::
debug
(
$add_result
);
Log
::
debug
(
$this
->
getParams
()[
'Campaigns'
][
$key
]);
...
...
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