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 8ff4c7fa
authored
Oct 07, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Исправление добавление приложений
1 parent
3a0b1f9a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
app/Models/Pivots/GoalAdExtension.php
app/Service/Requests/Direct/AddAdExtensions.php
app/Models/Pivots/GoalAdExtension.php
View file @
8ff4c7f
...
@@ -100,6 +100,12 @@ class GoalAdExtension extends Pivot
...
@@ -100,6 +100,12 @@ class GoalAdExtension extends Pivot
return
$this
->
belongsTo
(
AdExtension
::
class
,
'ad_extension_id'
);
return
$this
->
belongsTo
(
AdExtension
::
class
,
'ad_extension_id'
);
}
}
public
function
goalAdvertisements
()
{
return
$this
->
belongsToMany
(
GoalAdvertisement
::
class
,
GoalAdvertisementGoalAdExtension
::
getModel
()
->
getTable
(),
'goal_ad_extension_id'
,
'goal_advertisement_id'
)
->
using
(
AdGroupNegativeKeywordSharedSet
::
class
);
}
public
function
errors
()
public
function
errors
()
{
{
return
$this
->
morphMany
(
YandexError
::
class
,
'cause'
);
return
$this
->
morphMany
(
YandexError
::
class
,
'cause'
);
...
...
app/Service/Requests/Direct/AddAdExtensions.php
View file @
8ff4c7f
...
@@ -122,11 +122,15 @@ class AddAdExtensions extends DirectRequest
...
@@ -122,11 +122,15 @@ class AddAdExtensions extends DirectRequest
$this
->
setParams
([
$this
->
setParams
([
'AdExtensions'
=>
$this
->
goalAdExtensions
->
map
(
function
(
GoalAdExtension
$goalAdExtension
)
use
(
$variables
,
&
$lists
)
{
'AdExtensions'
=>
$this
->
goalAdExtensions
->
map
(
function
(
GoalAdExtension
$goalAdExtension
)
use
(
$variables
,
&
$lists
)
{
if
(
!
isset
(
$lists
[
$goalAdExtension
->
dictionary_campaign_id
]))
{
$advertisement
=
$goalAdExtension
->
goalAdvertisements
()
->
first
();
$list
=
Variable
::
getListVariablesByDictionaryCampaign
(
$goalAdExtension
->
dictionary_campaign_id
,
$variables
);
$lists
[
$goalAdExtension
->
dictionary_campaign_id
]
=
$list
;
$dictionary_campaign_id
=
$advertisement
?
$advertisement
->
dictionary_campaign_id
:
null
;
if
(
!
isset
(
$lists
[
$dictionary_campaign_id
]))
{
$list
=
Variable
::
getListVariablesByDictionaryCampaign
(
$dictionary_campaign_id
,
$variables
);
$lists
[
$dictionary_campaign_id
]
=
$list
;
}
else
{
}
else
{
$list
=
$lists
[
$
goalAdExtension
->
dictionary_campaign_id
];
$list
=
$lists
[
$dictionary_campaign_id
];
}
}
return
[
return
[
...
...
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