Commit ea21c834 by Vladislav

#20794 Сделать чтобы в целевых РК оставалась одна карточка (Исправление пометка …

…архивирования объявления, исправления опечатки при копировании архивногог объявления)
1 parent 9eef61e4
......@@ -170,7 +170,7 @@ class DictionaryCampaignsSyncByCampaign extends Command
LEFT JOIN goal_v_cards gvc on vc.id = gvc.v_card_id and gag.dictionary_campaign_id = gvc.dictionary_campaign_id and gvc.deleted_at is null
LEFT JOIN sitelinks s on ad.sitelink_external_id = s.external_id AND s.deleted_at is null
LEFT JOIN goal_sitelinks gs on s.id = gs.sitelink_id and gs.token_id = d.token_id AND gs.deleted_at is null
WHERE ad.deleted_at is null AND gad.advertisement_id is null and ad.state != '" . Advertisement::STATE_ARCHIVED . "}' and ad.archived_need is null and ad.campaign_id is not null
WHERE ad.deleted_at is null AND gad.advertisement_id is null and ad.state != '" . Advertisement::STATE_ARCHIVED . "' and ad.archived_need is null and ad.campaign_id is not null
and (ad.sitelink_external_id is null or (ad.sitelink_external_id is not null and s.id is not null))
and (ad.v_card_external_id is null or (ad.v_card_external_id is not null and vc.id is not null))
");
......
......@@ -160,6 +160,7 @@ class GetAds extends DirectRequest
if ($advertisement->state === Advertisement::STATE_ARCHIVED) {
$advertisement->goalAdvertisements()
->notNeedArchived()
->whereNull('deleted_need')
->update([
'archived_need' => Carbon::now(),
]);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!