Commit 7ceaa4ae by Vladislav

#19496 Запрос измененных объявлений

1 parent fe886b83
...@@ -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',
......
...@@ -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();
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!