Commit b335553d by Vladislav

#19461 Страница настройки целевых аккаунтов.

1 parent c54231c5
Showing with 10 additions and 2 deletions
......@@ -42,7 +42,7 @@ class Campaigns extends Model
{
parent::boot();
static::creating(function(Campaigns $campaign_new)
static::created(function(Campaigns $campaign_new)
{
Dictionary::whereNotNull('token_id')->each(function (Dictionary $dictionary) use ($campaign_new) {
$campaign_new->dictionaries()->syncWithoutDetaching([
......@@ -51,11 +51,19 @@ class Campaigns extends Model
});
});
/*
static::deleting(function(Campaigns $campaign_delete)
{
$campaign_delete->dictionaries()->sync([]);
$campaign_delete->dictionaries()->detach();
$campaign_delete->groups()->delete();
$campaign_delete->vars()->delete();
});
*/
}
public function groups()
{
return $this->hasMany(AdGroup::class, 'campaign_id');
}
public function vars()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!