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 7fc5b0f8
authored
Jun 30, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Id in api
1 parent
1887c95f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
app/Console/Commands/AdGroupsUpdate.php
app/Service/Requests/Direct/UpdateAdGroups.php
app/Console/Commands/AdGroupsUpdate.php
View file @
7fc5b0f
...
...
@@ -45,7 +45,6 @@ class AdGroupsUpdate extends Command
{
$tokens
=
Tokens
::
whereHas
(
'dictionaryCampaignsEnabledForExternalUpdated.groupsForExternalForNeedUpdatedForNotReserveUpdate.group'
)
->
where
(
'type'
,
'!='
,
Tokens
::
MAIN
)
->
where
(
'id'
,
6
)
->
get
();
foreach
(
$tokens
as
$token
)
{
...
...
app/Service/Requests/Direct/UpdateAdGroups.php
View file @
7fc5b0f
...
...
@@ -43,9 +43,20 @@ class UpdateAdGroups extends DirectRequest
foreach
(
$response
[
'result'
][
'UpdateResults'
]
as
$key
=>
$update_result
)
{
if
(
!
isset
(
$update_result
[
'Id'
]))
{
if
(
isset
(
$update_result
[
'Message'
])
&&
$update_result
[
'Message'
]
===
'Object not found'
)
{
$goalAdGroup
=
GoalAdGroup
::
whereExternalId
(
$this
->
getParams
()[
'AdGroups'
][
$key
][
'Id'
])
->
first
();
$goalAdGroup
->
goalKeywords
()
->
delete
();
$goalAdGroup
->
goalAdvertisements
()
->
delete
();
$goalAdGroup
->
goalBidModifiers
()
->
delete
();
$goalAdGroup
->
forceDelete
();
}
else
{
Log
::
debug
(
"UpdateAdGroup, empty Id"
);
Log
::
debug
(
$update_result
);
Log
::
debug
(
$this
->
getParams
()[
'AdGroups'
][
$key
]);
}
continue
;
}
...
...
@@ -91,7 +102,7 @@ class UpdateAdGroups extends DirectRequest
$list
=
Variable
::
getListVariablesByDictionaryCampaign
(
$goalAdGroup
->
dictionary_campaign_id
,
$variables
);
$data
=
[
'Id'
=>
$goalAdGroup
->
group
->
external_id
,
'Id'
=>
$goalAdGroup
->
external_id
,
'Name'
=>
StrReplaceByVariables
::
getInstance
(
$goalAdGroup
->
group
->
name
,
$list
)
->
get
(),
'RegionIds'
=>
$goalAdGroup
->
group
->
region_ids
,
];
...
...
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