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 92fc498d
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
99aea40d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
app/Service/Requests/Direct/AddAdGroups.php
app/Service/Requests/Direct/AddKeywords.php
app/Service/Requests/Direct/AddAdGroups.php
View file @
92fc498
...
...
@@ -6,7 +6,6 @@ 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
;
...
...
@@ -74,9 +73,6 @@ class AddAdGroups extends DirectRequest
$goalAdGroup
=
$this
->
goalAdGroups
->
get
(
$key
);
$goalAdGroup
=
GoalKeyword
::
find
(
$goalAdGroup
->
id
);
if
(
$goalAdGroup
)
{
$goalAdGroup
->
update
([
'external_id'
=>
$external_id
,
'external_upload_at'
=>
Carbon
::
now
(),
...
...
@@ -85,7 +81,6 @@ class AddAdGroups extends DirectRequest
$goalAdGroup
->
goalKeywords
()
->
update
([
'goal_ad_group_external_id'
=>
$external_id
,
]);
}
}
}
catch
(
\Exception
$e
)
{
...
...
app/Service/Requests/Direct/AddKeywords.php
View file @
92fc498
...
...
@@ -3,6 +3,7 @@
namespace
App\Service\Requests\Direct
;
use
App\Jobs\ProcessCallLimitedAPI
;
use
App\Models\Pivots\GoalKeyword
;
use
App\Models\Variable
;
use
App\Service\Contract\APIRequest
;
use
App\Service\Requests\DirectRequest
;
...
...
@@ -71,6 +72,19 @@ class AddKeywords extends DirectRequest
$goalKeyword
=
$this
->
goalKeywords
[
$key
];
$goalKeyword
=
GoalKeyword
::
find
(
$goalKeyword
->
id
);
if
(
$goalKeyword
)
{
$goalKeyword
->
update
([
'external_id'
=>
$external_id
,
'external_upload_at'
=>
Carbon
::
now
(),
]);
$goalKeyword
->
goalKeywords
()
->
update
([
'goal_ad_group_external_id'
=>
$external_id
,
]);
}
$goalKeyword
->
update
([
'external_id'
=>
$external_id
,
'external_upload_at'
=>
Carbon
::
now
(),
...
...
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