Commit 42787f19 by Vladislav

#20414 Загрузка и синхронизация VCards

1 parent c1ebf045
...@@ -56,9 +56,11 @@ class GoalAdvertisement extends Pivot ...@@ -56,9 +56,11 @@ class GoalAdvertisement extends Pivot
protected $fillable = [ protected $fillable = [
'external_id', 'external_id',
'goal_v_card_external_id', 'goal_v_card_external_id',
'goal_sitelink_external_id',
'goal_ad_group_external_id', 'goal_ad_group_external_id',
'dictionary_campaign_external_id', 'dictionary_campaign_external_id',
'goal_v_card_id', 'goal_v_card_id',
'goal_sitelink_id',
'goal_ad_group_id', 'goal_ad_group_id',
'dictionary_campaign_id', 'dictionary_campaign_id',
'advertisement_id', 'advertisement_id',
...@@ -85,9 +87,11 @@ class GoalAdvertisement extends Pivot ...@@ -85,9 +87,11 @@ class GoalAdvertisement extends Pivot
'id', 'id',
'external_id', 'external_id',
'goal_v_card_external_id', 'goal_v_card_external_id',
'goal_sitelink_external_id',
'goal_ad_group_external_id', 'goal_ad_group_external_id',
'dictionary_campaign_external_id', 'dictionary_campaign_external_id',
'goal_v_card_id', 'goal_v_card_id',
'goal_sitelink_id',
'goal_ad_group_id', 'goal_ad_group_id',
'dictionary_campaign_id', 'dictionary_campaign_id',
'advertisement_id', 'advertisement_id',
......
...@@ -99,4 +99,9 @@ class GoalSitelink extends Pivot ...@@ -99,4 +99,9 @@ class GoalSitelink extends Pivot
return $this->belongsTo(Sitelink::class, 'sitelink_id'); return $this->belongsTo(Sitelink::class, 'sitelink_id');
} }
public function goalAdvertisements()
{
return $this->hasMany(GoalAdvertisement::class, 'goal_sitelink_id');
}
} }
...@@ -108,4 +108,9 @@ class GoalVCard extends Pivot ...@@ -108,4 +108,9 @@ class GoalVCard extends Pivot
return $this->belongsTo(DictionaryCampaign::class, 'dictionary_campaign_id'); return $this->belongsTo(DictionaryCampaign::class, 'dictionary_campaign_id');
} }
public function goalAdvertisements()
{
return $this->hasMany(GoalAdvertisement::class, 'goal_v_card_id');
}
} }
...@@ -78,6 +78,10 @@ class AddSitelinks extends DirectRequest ...@@ -78,6 +78,10 @@ class AddSitelinks extends DirectRequest
'reserve_create_at' => null, 'reserve_create_at' => null,
]); ]);
$goalSitelink->goalAdvertisements()->update([
'goal_sitelink_external_id' => $external_id,
]);
} }
} catch (\Exception $e) { } catch (\Exception $e) {
Log::debug($e); Log::debug($e);
......
...@@ -80,6 +80,10 @@ class AddVCards extends DirectRequest ...@@ -80,6 +80,10 @@ class AddVCards extends DirectRequest
'reserve_create_at' => null, 'reserve_create_at' => null,
]); ]);
$goalVCard->goalAdvertisements()->update([
'goal_v_card_external_id' => $external_id,
]);
} }
} catch (\Exception $e) { } catch (\Exception $e) {
Log::debug($e); Log::debug($e);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!