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 2cf96902
authored
May 21, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#19463 Реализация методов обработки полей РК с заменой переменных
1 parent
b623b8eb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
app/Service/Requests/Direct/AddCampaigns.php
app/Service/Requests/Direct/AddCampaigns.php
View file @
2cf9690
...
...
@@ -65,8 +65,10 @@ class AddCampaigns extends DirectRequest
'Campaigns'
=>
$this
->
dictionaryCampaigns
->
map
(
function
(
$dictionaryCampaign
)
{
/* @var DictionaryCampaign $dictionaryCampaign */
$list
=
Variable
::
getListVariablesByDictionaryCampaign
(
$dictionaryCampaign
);
$data
=
[
'Name'
=>
StrReplaceByVariables
::
getInstance
(
$dictionaryCampaign
->
name
,
$
dictionaryCampaign
)
->
get
(),
'Name'
=>
StrReplaceByVariables
::
getInstance
(
$dictionaryCampaign
->
name
,
$
list
)
->
get
(),
'StartDate'
=>
Carbon
::
now
()
->
format
(
'Y-m-d'
),
'TextCampaign'
=>
[
'BiddingStrategy'
=>
[
...
...
@@ -92,8 +94,8 @@ class AddCampaigns extends DirectRequest
if
(
$dictionaryCampaign
->
negative_keywords
&&
count
(
$dictionaryCampaign
->
negative_keywords
))
{
$data
[
'NegativeKeywords'
]
=
[
'Items'
=>
array_map
(
function
(
$value
)
use
(
$
variable_
list
)
{
return
StrReplaceByVariables
::
getInstance
(
$value
,
$
variable_
list
)
->
get
();
'Items'
=>
array_map
(
function
(
$value
)
use
(
$list
)
{
return
StrReplaceByVariables
::
getInstance
(
$value
,
$list
)
->
get
();
},
$dictionaryCampaign
->
negative_keywords
),
];
}
...
...
@@ -106,8 +108,8 @@ class AddCampaigns extends DirectRequest
if
(
$dictionaryCampaign
->
excluded_sites
&&
count
(
$dictionaryCampaign
->
excluded_sites
))
{
$data
[
'ExcludedSites'
]
=
[
'Items'
=>
array_map
(
function
(
$value
)
use
(
$
variable_
list
)
{
return
StrReplaceByVariables
::
getInstance
(
$value
,
$
variable_
list
)
->
get
();
'Items'
=>
array_map
(
function
(
$value
)
use
(
$list
)
{
return
StrReplaceByVariables
::
getInstance
(
$value
,
$list
)
->
get
();
},
$dictionaryCampaign
->
excluded_sites
),
];
}
...
...
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