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 68f31b2a
authored
Jul 07, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#19496 Запрос измененных объявлений
1 parent
27516d79
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
5 deletions
app/Console/Commands/AdvertisementsAdd.php
app/Console/Commands/AdvertisementsUpdate.php
app/Service/Requests/Direct/AddAds.php
app/Service/Requests/Direct/UpdateAds.php
app/Console/Commands/AdvertisementsAdd.php
View file @
68f31b2
...
...
@@ -67,6 +67,13 @@ class AdvertisementsAdd extends Command
->
whereNull
(
'goal_ad_extensions.external_id'
)
->
whereColumn
(
'goal_advertisements.id'
,
'goal_advertisement_goal_ad_extensions.goal_advertisement_id'
);
})
->
where
(
function
(
Builder
$query
)
{
$query
->
whereNull
(
'goal_advertisements.goal_v_card_id'
)
->
orWhere
(
function
(
Builder
$query
)
{
$query
->
whereNotNull
(
'goal_advertisements.goal_v_card_id'
)
->
whereNotNull
(
'goal_advertisements.goal_v_card_external_id'
);
});
})
->
whereNull
(
'advertisements.deleted_at'
)
->
whereNull
(
'goal_advertisements.external_id'
)
->
whereNull
(
'goal_advertisements.reserve_create_at'
)
...
...
@@ -83,7 +90,7 @@ class AdvertisementsAdd extends Command
'advertisements.title2 as title2'
,
'advertisements.href as href'
,
'advertisements.display_url_path as display_url_path'
,
'
advertisements.v_card_external_id as
v_card_external_id'
,
'
goal_advertisements.goal_v_card_external_id as goal_
v_card_external_id'
,
'advertisements.ad_image_hash as ad_image_hash'
,
'advertisements.site_link_set_id as site_link_set_id'
,
DB
::
raw
(
'JSON_ARRAYAGG(goal_ad_extensions.external_id) as ad_extension_ids'
),
...
...
@@ -97,6 +104,10 @@ class AdvertisementsAdd extends Command
->
groupBy
(
'goal_advertisements.id'
)
->
get
();
if
(
!
$goalAds
->
count
())
{
continue
;
}
foreach
(
array_chunk
(
$goalAds
->
pluck
(
'id'
)
->
toArray
(),
1000
)
as
$items
)
{
GoalAdvertisement
::
whereIn
(
'id'
,
$items
)
->
update
([
...
...
app/Console/Commands/AdvertisementsUpdate.php
View file @
68f31b2
...
...
@@ -73,7 +73,7 @@ class AdvertisementsUpdate extends Command
'advertisements.title2 as title2'
,
'advertisements.href as href'
,
'advertisements.display_url_path as display_url_path'
,
'
advertisements.v_card_external_id as
v_card_external_id'
,
'
goal_advertisements.goal_v_card_external_id as goal_
v_card_external_id'
,
'advertisements.ad_image_hash as ad_image_hash'
,
'advertisements.site_link_set_id as site_link_set_id'
,
DB
::
raw
(
"JSON_OBJECTAGG('AdExtensionId', goal_ad_extensions.external_id, 'Operation', 'SET') as ad_extensions"
),
...
...
app/Service/Requests/Direct/AddAds.php
View file @
68f31b2
...
...
@@ -147,7 +147,7 @@ class AddAds extends DirectRequest
}
if
(
$goalAdvertisement
->
v_card_external_id
)
{
$data
[
'TextAd'
][
'VCardId'
]
=
$goalAdvertisement
->
v_card_external_id
;
$data
[
'TextAd'
][
'VCardId'
]
=
$goalAdvertisement
->
goal_
v_card_external_id
;
}
if
(
$goalAdvertisement
->
ad_image_hash
)
{
...
...
app/Service/Requests/Direct/UpdateAds.php
View file @
68f31b2
...
...
@@ -130,8 +130,8 @@ class UpdateAds extends DirectRequest
$data
[
'TextAd'
][
'DisplayUrlPath'
]
=
StrReplaceByVariables
::
getInstance
(
$goalAdvertisement
->
display_url_path
,
$list
)
->
get
();
}
if
(
$goalAdvertisement
->
v_card_external_id
)
{
$data
[
'TextAd'
][
'VCardId'
]
=
$goalAdvertisement
->
v_card_external_id
;
if
(
$goalAdvertisement
->
goal_
v_card_external_id
)
{
$data
[
'TextAd'
][
'VCardId'
]
=
$goalAdvertisement
->
goal_
v_card_external_id
;
}
if
(
$goalAdvertisement
->
ad_image_hash
)
{
...
...
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