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 8b8d77fc
authored
Jul 20, 2021
by
Евгений
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Улучшение #20443
Загрузка и синхронизация изображений
1 parent
5d378d10
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
3 deletions
app/Console/Commands/AdvertisementsAdd.php
app/Console/Commands/AdvertisementsUpdate.php
app/Console/Kernel.php
config/database.php
app/Console/Commands/AdvertisementsAdd.php
View file @
8b8d77f
...
@@ -53,6 +53,11 @@ class AdvertisementsAdd extends Command
...
@@ -53,6 +53,11 @@ class AdvertisementsAdd extends Command
->
join
(
'advertisements'
,
'goal_advertisements.advertisement_id'
,
'='
,
'advertisements.id'
)
->
join
(
'advertisements'
,
'goal_advertisements.advertisement_id'
,
'='
,
'advertisements.id'
)
->
leftJoin
(
'goal_advertisement_goal_ad_extensions'
,
'goal_advertisements.id'
,
'='
,
'goal_advertisement_goal_ad_extensions.goal_advertisement_id'
)
->
leftJoin
(
'goal_advertisement_goal_ad_extensions'
,
'goal_advertisements.id'
,
'='
,
'goal_advertisement_goal_ad_extensions.goal_advertisement_id'
)
->
leftJoin
(
'goal_ad_extensions'
,
'goal_advertisement_goal_ad_extensions.goal_ad_extension_id'
,
'='
,
'goal_ad_extensions.id'
)
->
leftJoin
(
'goal_ad_extensions'
,
'goal_advertisement_goal_ad_extensions.goal_ad_extension_id'
,
'='
,
'goal_ad_extensions.id'
)
->
leftJoin
(
'ad_images'
,
'advertisements.ad_image_hash'
,
'='
,
'ad_images.hash'
)
->
leftJoin
(
'goal_ad_images'
,
function
(
$join
)
use
(
$token
)
{
$join
->
on
(
'goal_ad_images.ad_image_id'
,
'='
,
'ad_images.id'
);
$join
->
on
(
'goal_ad_images.token_id'
,
'='
,
$token
->
id
);
})
->
whereNotExists
(
function
(
Builder
$query
)
{
->
whereNotExists
(
function
(
Builder
$query
)
{
$query
->
select
(
DB
::
raw
(
1
))
$query
->
select
(
DB
::
raw
(
1
))
->
from
(
'goal_advertisement_goal_ad_extensions'
)
->
from
(
'goal_advertisement_goal_ad_extensions'
)
...
@@ -91,7 +96,7 @@ class AdvertisementsAdd extends Command
...
@@ -91,7 +96,7 @@ class AdvertisementsAdd extends Command
'advertisements.href as href'
,
'advertisements.href as href'
,
'advertisements.display_url_path as display_url_path'
,
'advertisements.display_url_path as display_url_path'
,
'goal_advertisements.goal_v_card_external_id as goal_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'
,
'
goal_ad_images.
hash as ad_image_hash'
,
'goal_advertisements.goal_sitelink_external_id as goal_sitelink_external_id'
,
'goal_advertisements.goal_sitelink_external_id as goal_sitelink_external_id'
,
DB
::
raw
(
'JSON_ARRAYAGG(goal_ad_extensions.external_id) as ad_extension_ids'
),
DB
::
raw
(
'JSON_ARRAYAGG(goal_ad_extensions.external_id) as ad_extension_ids'
),
'advertisements.ad_extensions as ad_extensions'
,
'advertisements.ad_extensions as ad_extensions'
,
...
...
app/Console/Commands/AdvertisementsUpdate.php
View file @
8b8d77f
...
@@ -52,6 +52,11 @@ class AdvertisementsUpdate extends Command
...
@@ -52,6 +52,11 @@ class AdvertisementsUpdate extends Command
->
join
(
'advertisements'
,
'goal_advertisements.advertisement_id'
,
'='
,
'advertisements.id'
)
->
join
(
'advertisements'
,
'goal_advertisements.advertisement_id'
,
'='
,
'advertisements.id'
)
->
leftJoin
(
'goal_advertisement_goal_ad_extensions'
,
'goal_advertisements.id'
,
'='
,
'goal_advertisement_goal_ad_extensions.goal_advertisement_id'
)
->
leftJoin
(
'goal_advertisement_goal_ad_extensions'
,
'goal_advertisements.id'
,
'='
,
'goal_advertisement_goal_ad_extensions.goal_advertisement_id'
)
->
leftJoin
(
'goal_ad_extensions'
,
'goal_advertisement_goal_ad_extensions.goal_ad_extension_id'
,
'='
,
'goal_ad_extensions.id'
)
->
leftJoin
(
'goal_ad_extensions'
,
'goal_advertisement_goal_ad_extensions.goal_ad_extension_id'
,
'='
,
'goal_ad_extensions.id'
)
->
leftJoin
(
'ad_images'
,
'advertisements.ad_image_hash'
,
'='
,
'ad_images.hash'
)
->
leftJoin
(
'goal_ad_images'
,
function
(
$join
)
use
(
$token
)
{
$join
->
on
(
'goal_ad_images.ad_image_id'
,
'='
,
'ad_images.id'
);
$join
->
on
(
'goal_ad_images.token_id'
,
'='
,
DB
::
raw
(
$token
->
id
)
);
})
->
whereNotExists
(
function
(
Builder
$query
)
{
->
whereNotExists
(
function
(
Builder
$query
)
{
$query
->
select
(
DB
::
raw
(
1
))
$query
->
select
(
DB
::
raw
(
1
))
->
from
(
'goal_advertisement_goal_ad_extensions'
)
->
from
(
'goal_advertisement_goal_ad_extensions'
)
...
@@ -89,7 +94,7 @@ class AdvertisementsUpdate extends Command
...
@@ -89,7 +94,7 @@ class AdvertisementsUpdate extends Command
'advertisements.href as href'
,
'advertisements.href as href'
,
'advertisements.display_url_path as display_url_path'
,
'advertisements.display_url_path as display_url_path'
,
'goal_advertisements.goal_v_card_external_id as goal_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'
,
'
goal_ad_images.
hash as ad_image_hash'
,
'goal_advertisements.goal_sitelink_external_id as goal_sitelink_external_id'
,
'goal_advertisements.goal_sitelink_external_id as goal_sitelink_external_id'
,
DB
::
raw
(
"JSON_ARRAYAGG(JSON_OBJECT('AdExtensionId', goal_ad_extensions.external_id, 'Operation', 'SET')) as ad_extensions"
),
DB
::
raw
(
"JSON_ARRAYAGG(JSON_OBJECT('AdExtensionId', goal_ad_extensions.external_id, 'Operation', 'SET')) as ad_extensions"
),
'advertisements.video_extension as video_extension'
,
'advertisements.video_extension as video_extension'
,
...
...
app/Console/Kernel.php
View file @
8b8d77f
...
@@ -7,6 +7,7 @@ use App\Console\Commands\AdExtensionsLoad;
...
@@ -7,6 +7,7 @@ use App\Console\Commands\AdExtensionsLoad;
use
App\Console\Commands\AdGroupsAdd
;
use
App\Console\Commands\AdGroupsAdd
;
use
App\Console\Commands\AdGroupsLoadUpdated
;
use
App\Console\Commands\AdGroupsLoadUpdated
;
use
App\Console\Commands\AdGroupsUpdate
;
use
App\Console\Commands\AdGroupsUpdate
;
use
App\Console\Commands\AdImagesAdd
;
use
App\Console\Commands\AdImagesLoad
;
use
App\Console\Commands\AdImagesLoad
;
use
App\Console\Commands\AdvertisementsAdd
;
use
App\Console\Commands\AdvertisementsAdd
;
use
App\Console\Commands\AdvertisementsLoadUpdated
;
use
App\Console\Commands\AdvertisementsLoadUpdated
;
...
@@ -92,6 +93,7 @@ class Kernel extends ConsoleKernel
...
@@ -92,6 +93,7 @@ class Kernel extends ConsoleKernel
$schedule
->
command
(
VCardsLoad
::
class
)
->
hourlyAt
(
25
);
$schedule
->
command
(
VCardsLoad
::
class
)
->
hourlyAt
(
25
);
$schedule
->
command
(
VCardsAdd
::
class
)
->
hourlyAt
(
35
);
$schedule
->
command
(
VCardsAdd
::
class
)
->
hourlyAt
(
35
);
$schedule
->
command
(
AdImagesAdd
::
class
)
->
hourlyAt
(
35
);
$schedule
->
command
(
AdExtensionsAdd
::
class
)
->
hourlyAt
(
35
);
$schedule
->
command
(
AdExtensionsAdd
::
class
)
->
hourlyAt
(
35
);
$schedule
->
command
(
SitelinksAdd
::
class
)
->
hourlyAt
(
35
);
$schedule
->
command
(
SitelinksAdd
::
class
)
->
hourlyAt
(
35
);
$schedule
->
command
(
NegativeKeywordSharedSetsAdd
::
class
)
->
hourlyAt
(
35
);
$schedule
->
command
(
NegativeKeywordSharedSetsAdd
::
class
)
->
hourlyAt
(
35
);
...
...
config/database.php
View file @
8b8d77f
...
@@ -56,7 +56,7 @@ return [
...
@@ -56,7 +56,7 @@ return [
'collation'
=>
'utf8mb4_unicode_ci'
,
'collation'
=>
'utf8mb4_unicode_ci'
,
'prefix'
=>
''
,
'prefix'
=>
''
,
'prefix_indexes'
=>
true
,
'prefix_indexes'
=>
true
,
'strict'
=>
tru
e
,
'strict'
=>
fals
e
,
'engine'
=>
null
,
'engine'
=>
null
,
'options'
=>
extension_loaded
(
'pdo_mysql'
)
?
array_filter
([
'options'
=>
extension_loaded
(
'pdo_mysql'
)
?
array_filter
([
PDO
::
MYSQL_ATTR_SSL_CA
=>
env
(
'MYSQL_ATTR_SSL_CA'
),
PDO
::
MYSQL_ATTR_SSL_CA
=>
env
(
'MYSQL_ATTR_SSL_CA'
),
...
...
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