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 90373de9
authored
Jul 05, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rollback BidModifiersAdd
1 parent
4dda251f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
13 deletions
app/Console/Commands/BidModifiersAdd.php
app/Service/Requests/Direct/AddBidModifiers.php
app/Console/Commands/BidModifiersAdd.php
View file @
90373de
...
@@ -67,14 +67,20 @@ class BidModifiersAdd extends Command
...
@@ -67,14 +67,20 @@ class BidModifiersAdd extends Command
});
});
})
})
->
whereIn
(
'goal_bid_modifiers.dictionary_campaign_id'
,
$token
->
dictionaryCampaignsEnabledForExternalSynchronized
->
pluck
(
'id'
))
->
whereIn
(
'goal_bid_modifiers.dictionary_campaign_id'
,
$token
->
dictionaryCampaignsEnabledForExternalSynchronized
->
pluck
(
'id'
))
->
groupBy
([
'goal_bid_modifiers.dictionary_campaign_external_id'
,
'goal_bid_modifiers.goal_ad_group_external_id'
,
'bid_modifiers.mobile_adjustment'
,
'bid_modifiers.desktop_adjustment'
,
])
->
select
([
->
select
([
'goal_bid_modifiers.id as id'
,
DB
::
raw
(
'json_arrayagg(bid_modifiers.id) as ids'
)
,
'goal_bid_modifiers.dictionary_campaign_external_id as dictionary_campaign_external_id'
,
'goal_bid_modifiers.dictionary_campaign_external_id as dictionary_campaign_external_id'
,
'goal_bid_modifiers.goal_ad_group_external_id as goal_ad_group_external_id'
,
'goal_bid_modifiers.goal_ad_group_external_id as goal_ad_group_external_id'
,
'bid_modifiers.mobile_adjustment as mobile_adjustment'
,
'bid_modifiers.mobile_adjustment as mobile_adjustment'
,
'bid_modifiers.desktop_adjustment as desktop_adjustment'
,
'bid_modifiers.desktop_adjustment as desktop_adjustment'
,
'bid_modifiers.demographics_adjustment as demographics_adjustment'
,
DB
::
raw
(
'json_arrayagg(bid_modifiers.demographics_adjustment) as demographics_adjustments'
)
,
'bid_modifiers.retargeting_adjustment as retargeting_adjustment'
,
DB
::
raw
(
'json_arrayagg(bid_modifiers.retargeting_adjustment) as retargeting_adjustments'
)
,
])
])
->
get
();
->
get
();
...
...
app/Service/Requests/Direct/AddBidModifiers.php
View file @
90373de
...
@@ -74,7 +74,7 @@ class AddBidModifiers extends DirectRequest
...
@@ -74,7 +74,7 @@ class AddBidModifiers extends DirectRequest
$external_id
=
(
string
)
$add_result
[
'Id'
];
$external_id
=
(
string
)
$add_result
[
'Id'
];
GoalBidModifier
::
where
(
'id'
,
$goalBidModifier
->
id
)
GoalBidModifier
::
where
In
(
'id'
,
$goalBidModifier
->
ids
)
->
update
([
->
update
([
'external_id'
=>
$external_id
,
'external_id'
=>
$external_id
,
'external_upload_at'
=>
Carbon
::
now
(),
'external_upload_at'
=>
Carbon
::
now
(),
...
@@ -90,7 +90,7 @@ class AddBidModifiers extends DirectRequest
...
@@ -90,7 +90,7 @@ class AddBidModifiers extends DirectRequest
public
function
failed
()
public
function
failed
()
{
{
GoalBidModifier
::
whereIn
(
'id'
,
$this
->
goalBidModifiers
->
pluck
(
'id
'
)
->
toArray
())
GoalBidModifier
::
whereIn
(
'id'
,
$this
->
goalBidModifiers
->
pluck
(
'id
s'
)
->
collapse
(
)
->
toArray
())
->
update
([
->
update
([
'reserve_create_at'
=>
null
,
'reserve_create_at'
=>
null
,
]);
]);
...
@@ -129,7 +129,7 @@ class AddBidModifiers extends DirectRequest
...
@@ -129,7 +129,7 @@ class AddBidModifiers extends DirectRequest
$data
[
'DesktopAdjustment'
]
=
$desktop_adjustment
;
$data
[
'DesktopAdjustment'
]
=
$desktop_adjustment
;
}
elseif
(
$demographics_adjustment
=
@
json_decode
(
$goalBidModifier
->
demographics_adjustment
,
true
)
)
{
}
elseif
(
$demographics_adjustment
s
=
array_map
(
function
(
$demographics_adjustment
)
{
unset
(
$demographics_adjustment
[
'Enabled'
]);
unset
(
$demographics_adjustment
[
'Enabled'
]);
...
@@ -140,18 +140,24 @@ class AddBidModifiers extends DirectRequest
...
@@ -140,18 +140,24 @@ class AddBidModifiers extends DirectRequest
unset
(
$demographics_adjustment
[
'Age'
]);
unset
(
$demographics_adjustment
[
'Age'
]);
}
}
$data
[
'DemographicsAdjustments'
]
=
[
return
$demographics_adjustment
;
$demographics_adjustment
];
},
array_filter
(
@
json_decode
(
$goalBidModifier
->
demographics_adjustments
,
true
))))
{
}
elseif
(
$retargeting_adjustment
=
@
json_decode
(
$goalBidModifier
->
retargeting_adjustment
,
true
))
{
$data
[
'DemographicsAdjustments'
]
=
$demographics_adjustments
;
}
elseif
(
$retargeting_adjustments
=
array_map
(
function
(
$retargeting_adjustment
)
{
unset
(
$retargeting_adjustment
[
'Accessible'
]);
unset
(
$retargeting_adjustment
[
'Accessible'
]);
unset
(
$retargeting_adjustment
[
'Enabled'
]);
unset
(
$retargeting_adjustment
[
'Enabled'
]);
$data
[
'RetargetingAdjustments'
]
=
[
return
$retargeting_adjustment
;
$retargeting_adjustment
];
},
array_filter
(
@
json_decode
(
$goalBidModifier
->
retargeting_adjustments
,
true
))))
{
$data
[
'RetargetingAdjustments'
]
=
$retargeting_adjustments
;
}
}
return
$data
;
return
$data
;
...
...
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