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 beb1867e
authored
Jul 12, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#19500 Синхронизация модификаторов.
1 parent
1cb1c537
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
4 deletions
app/Console/Commands/DictionaryCampaignsSyncByCampaign.php
app/Console/Commands/RetargetinglistsAdd.php
app/Models/Retargetinglist.php
app/Service/Requests/Direct/AddRetargetinglists.php
app/Console/Commands/DictionaryCampaignsSyncByCampaign.php
View file @
beb1867
...
@@ -223,7 +223,17 @@ class DictionaryCampaignsSyncByCampaign extends Command
...
@@ -223,7 +223,17 @@ class DictionaryCampaignsSyncByCampaign extends Command
WHERE gagae.goal_ad_extension_id is null
WHERE gagae.goal_ad_extension_id is null
"
);
"
);
//грузим объявления которых по какой то причне нет в целевых.
//грузим расширения которых по какой то причне нет в целевых.
DB
::
insert
(
"
INSERT INTO goal_retargetinglists(retargetinglist_id, token_id, created_at, updated_at)
SELECT r.id, t.id, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP
FROM retargetinglists r
INNER JOIN tokens t on t.type != '"
.
Tokens
::
MAIN
.
"'
LEFT JOIN goal_retargetinglists gt on r.id = gt.retargetinglist_id and t.id = gt.token_id
WHERE gt.retargetinglist_id is null AND gt.deleted_at is null
"
);
//грузим условия ретаргетинга и подбора аудитории которых по какой то причне нет в целевых.
DB
::
insert
(
"
DB
::
insert
(
"
INSERT INTO goal_bid_modifiers(dictionary_campaign_external_id, goal_ad_group_external_id, dictionary_campaign_id,
INSERT INTO goal_bid_modifiers(dictionary_campaign_external_id, goal_ad_group_external_id, dictionary_campaign_id,
goal_ad_group_id, bid_modifier_id, created_at, updated_at)
goal_ad_group_id, bid_modifier_id, created_at, updated_at)
...
...
app/Console/Commands/RetargetinglistsAdd.php
View file @
beb1867
...
@@ -4,6 +4,7 @@ namespace App\Console\Commands;
...
@@ -4,6 +4,7 @@ namespace App\Console\Commands;
use
App\Models\Pivots\GoalSitelink
;
use
App\Models\Pivots\GoalSitelink
;
use
App\Models\Tokens
;
use
App\Models\Tokens
;
use
App\Service\Requests\Direct\AddRetargetinglists
;
use
App\Service\Requests\Direct\AddSitelinks
;
use
App\Service\Requests\Direct\AddSitelinks
;
use
Carbon\Carbon
;
use
Carbon\Carbon
;
use
Illuminate\Console\Command
;
use
Illuminate\Console\Command
;
...
@@ -64,7 +65,7 @@ class RetargetinglistsAdd extends Command
...
@@ -64,7 +65,7 @@ class RetargetinglistsAdd extends Command
]);
]);
}
}
$request
=
new
Add
Sitelink
s
();
$request
=
new
Add
Retargetinglist
s
();
$request
->
setToken
(
$token
)
$request
->
setToken
(
$token
)
->
call
([
->
call
([
'goalRetargetinglists'
=>
$goalRetargetinglists
,
'goalRetargetinglists'
=>
$goalRetargetinglists
,
...
...
app/Models/Retargetinglist.php
View file @
beb1867
...
@@ -17,6 +17,7 @@ class Retargetinglist extends Model
...
@@ -17,6 +17,7 @@ class Retargetinglist extends Model
protected
$table
=
'retargetinglists'
;
protected
$table
=
'retargetinglists'
;
protected
$fillable
=
[
protected
$fillable
=
[
'external_id'
,
'type'
,
'type'
,
'name'
,
'name'
,
'description'
,
'description'
,
...
...
app/Service/Requests/Direct/AddRetargetinglists.php
View file @
beb1867
...
@@ -60,7 +60,7 @@ class AddRetargetinglists extends DirectRequest
...
@@ -60,7 +60,7 @@ class AddRetargetinglists extends DirectRequest
$goalSitelink
=
$this
->
goalRetargetinglists
->
get
(
$key
);
$goalSitelink
=
$this
->
goalRetargetinglists
->
get
(
$key
);
if
(
!
isset
(
$add_result
[
'Id'
]))
{
if
(
!
isset
(
$add_result
[
'Id'
]))
{
Log
::
debug
(
"Add
Sitelink
, empty Id"
);
Log
::
debug
(
"Add
Retargetinglist
, empty Id"
);
Log
::
debug
(
$add_result
);
Log
::
debug
(
$add_result
);
Log
::
debug
(
$this
->
getParams
()[
'RetargetingLists'
][
$key
]);
Log
::
debug
(
$this
->
getParams
()[
'RetargetingLists'
][
$key
]);
...
@@ -124,7 +124,7 @@ class AddRetargetinglists extends DirectRequest
...
@@ -124,7 +124,7 @@ class AddRetargetinglists extends DirectRequest
'Type'
=>
$goalRetargetinglist
->
retargetinglist
->
type
,
'Type'
=>
$goalRetargetinglist
->
retargetinglist
->
type
,
'Name'
=>
StrReplaceByVariables
::
getInstance
(
$goalRetargetinglist
->
retargetinglist
->
name
,
$list
)
->
get
(),
'Name'
=>
StrReplaceByVariables
::
getInstance
(
$goalRetargetinglist
->
retargetinglist
->
name
,
$list
)
->
get
(),
'Description'
=>
StrReplaceByVariables
::
getInstance
(
$goalRetargetinglist
->
retargetinglist
->
description
,
$list
)
->
get
(),
'Description'
=>
StrReplaceByVariables
::
getInstance
(
$goalRetargetinglist
->
retargetinglist
->
description
,
$list
)
->
get
(),
'
r
ules'
=>
$goalRetargetinglist
->
retargetinglist
->
rules
,
'
R
ules'
=>
$goalRetargetinglist
->
retargetinglist
->
rules
,
];
];
})
->
toArray
(),
})
->
toArray
(),
...
...
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