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 7ceaa4ae
authored
Jun 30, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#19496 Запрос измененных объявлений
1 parent
fe886b83
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
app/Console/Commands/AdvertisementsUpdate.php
app/Service/Requests/Direct/UpdateAds.php
app/Console/Commands/AdvertisementsUpdate.php
View file @
7ceaa4a
...
@@ -57,17 +57,17 @@ class AdvertisementsUpdate extends Command
...
@@ -57,17 +57,17 @@ class AdvertisementsUpdate extends Command
$goalAds
=
DB
::
table
(
'goal_advertisements'
)
$goalAds
=
DB
::
table
(
'goal_advertisements'
)
->
join
(
'advertisements'
,
'goal_advertisements.advertisement_id'
,
'='
,
'advertisements.id'
)
->
join
(
'advertisements'
,
'goal_advertisements.advertisement_id'
,
'='
,
'advertisements.id'
)
->
whereNull
(
'advertisements.deleted_at'
)
->
whereNull
(
'advertisements.deleted_at'
)
->
whereNull
(
'advertisements.reserve_update_at'
)
->
whereNull
(
'
goal_
advertisements.reserve_update_at'
)
->
whereNotNull
(
'goal_advertisements.updated_need'
)
->
whereNotNull
(
'goal_advertisements.updated_need'
)
->
whereNotNull
(
'goal_advertisements.goal_ad_group_external_id'
)
->
whereNotNull
(
'goal_advertisements.goal_ad_group_external_id'
)
->
whereNotNull
(
'goal_advertisements.dictionary_campaign_external_id'
)
->
whereNotNull
(
'goal_advertisements.dictionary_campaign_external_id'
)
->
whereIn
(
'goal_advertisements.dictionary_campaign_id'
,
$token
->
dictionaryCampaignsEnabledForExternalSynchronized
->
pluck
(
'id'
))
->
whereIn
(
'goal_advertisements.dictionary_campaign_id'
,
$token
->
dictionaryCampaignsEnabledForExternalSynchronized
->
pluck
(
'id'
))
->
select
([
->
select
([
'goal_advertisements.
id as
id'
,
'goal_advertisements.
external_id as external_
id'
,
'goal_advertisements.dictionary_campaign_id as dictionary_campaign_id'
,
'goal_advertisements.dictionary_campaign_id as dictionary_campaign_id'
,
'advertisements.title as title'
,
'advertisements.title as title'
,
'advertisements.text as text'
,
'advertisements.text as text'
,
'advertisements.
mobile as mobile
'
,
'advertisements.
age_label as age_label
'
,
'advertisements.title2 as title2'
,
'advertisements.title2 as title2'
,
'advertisements.href as href'
,
'advertisements.href as href'
,
'advertisements.display_url_path as display_url_path'
,
'advertisements.display_url_path as display_url_path'
,
...
...
app/Service/Requests/Direct/UpdateAds.php
View file @
7ceaa4a
...
@@ -43,7 +43,7 @@ class UpdateAds extends DirectRequest
...
@@ -43,7 +43,7 @@ class UpdateAds extends DirectRequest
}
}
foreach
(
$response
[
'result'
][
'UpdateResults'
]
as
$key
=>
$update_result
)
{
foreach
(
$response
[
'result'
][
'UpdateResults'
]
as
$key
=>
$update_result
)
{
if
(
!
isset
(
$
add
_result
[
'Id'
]))
{
if
(
!
isset
(
$
update
_result
[
'Id'
]))
{
Log
::
debug
(
"UpdateAds, empty Id"
);
Log
::
debug
(
"UpdateAds, empty Id"
);
Log
::
debug
(
$update_result
);
Log
::
debug
(
$update_result
);
Log
::
debug
(
$this
->
getParams
()[
'Ads'
][
$key
]);
Log
::
debug
(
$this
->
getParams
()[
'Ads'
][
$key
]);
...
@@ -105,11 +105,13 @@ class UpdateAds extends DirectRequest
...
@@ -105,11 +105,13 @@ class UpdateAds extends DirectRequest
'TextAd'
=>
[
'TextAd'
=>
[
'Title'
=>
StrReplaceByVariables
::
getInstance
(
$goalAdvertisement
->
title
,
$list
)
->
get
(),
'Title'
=>
StrReplaceByVariables
::
getInstance
(
$goalAdvertisement
->
title
,
$list
)
->
get
(),
'Text'
=>
StrReplaceByVariables
::
getInstance
(
$goalAdvertisement
->
text
,
$list
)
->
get
(),
'Text'
=>
StrReplaceByVariables
::
getInstance
(
$goalAdvertisement
->
text
,
$list
)
->
get
(),
'Mobile'
=>
$goalAdvertisement
->
mobile
?
'YES'
:
'NO'
,
'AgeLabel'
=>
$goalAdvertisement
->
age_label
,
],
],
];
];
if
(
$goalAdvertisement
->
age_label
)
{
$data
[
'TextAd'
][
'AgeLabel'
]
=
$goalAdvertisement
->
age_label
;
}
if
(
$goalAdvertisement
->
title2
)
{
if
(
$goalAdvertisement
->
title2
)
{
$data
[
'TextAd'
][
'Title2'
]
=
StrReplaceByVariables
::
getInstance
(
$goalAdvertisement
->
title2
,
$list
)
->
get
();
$data
[
'TextAd'
][
'Title2'
]
=
StrReplaceByVariables
::
getInstance
(
$goalAdvertisement
->
title2
,
$list
)
->
get
();
}
}
...
...
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