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 99aea40d
authored
Jun 18, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix save update external key after add in api
1 parent
e3a11de7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
app/Console/Commands/KeywordsAdd.php
app/Service/Requests/Direct/AddAdGroups.php
app/Console/Commands/KeywordsAdd.php
View file @
99aea40
...
...
@@ -65,6 +65,7 @@ class KeywordsAdd extends Command
->
whereNull
(
'goal_keywords.external_id'
)
->
whereIn
(
'goal_keywords.dictionary_campaign_id'
,
$token
->
dictionaryCampaignsEnabledForExternalSynchronized
->
pluck
(
'id'
))
->
select
([
'goal_keywords.id as id'
,
'goal_keywords.dictionary_campaign_id as dictionary_campaign_id'
,
'goal_keywords.goal_ad_group_external_id as goal_ad_group_external_id'
,
'keywords.keyword as keyword'
,
...
...
app/Service/Requests/Direct/AddAdGroups.php
View file @
99aea40
...
...
@@ -6,6 +6,7 @@ use App\Jobs\ProcessCallLimitedAPI;
use
App\Models\Campaigns
;
use
App\Models\Pivots\DictionaryCampaign
;
use
App\Models\Pivots\GoalAdGroup
;
use
App\Models\Pivots\GoalKeyword
;
use
App\Models\Variable
;
use
App\Service\Contract\APIRequest
;
use
App\Service\Requests\DirectRequest
;
...
...
@@ -73,14 +74,18 @@ class AddAdGroups extends DirectRequest
$goalAdGroup
=
$this
->
goalAdGroups
->
get
(
$key
);
$goalAdGroup
->
update
([
'external_id'
=>
$external_id
,
'external_upload_at'
=>
Carbon
::
now
(),
]);
$goalAdGroup
=
GoalKeyword
::
find
(
$goalAdGroup
->
id
);
$goalAdGroup
->
goalKeywords
()
->
update
([
'goal_ad_group_external_id'
=>
$external_id
,
]);
if
(
$goalAdGroup
)
{
$goalAdGroup
->
update
([
'external_id'
=>
$external_id
,
'external_upload_at'
=>
Carbon
::
now
(),
]);
$goalAdGroup
->
goalKeywords
()
->
update
([
'goal_ad_group_external_id'
=>
$external_id
,
]);
}
}
}
catch
(
\Exception
$e
)
{
...
...
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