Commit 50e3a42a by Vladislav

#21104 Перенос проекта в продакшн

1 parent 6c9572b9
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Models\NegativeKeywordSharedSet;
use App\Models\Pivots\DictionaryCampaign; use App\Models\Pivots\DictionaryCampaign;
use App\Models\Pivots\GoalRetargetinglist;
use App\Models\Tokens; use App\Models\Tokens;
use App\Models\Variable; use App\Models\Variable;
use Carbon\Carbon; use Carbon\Carbon;
...@@ -197,8 +199,25 @@ class CampaignVariablesController extends Controller ...@@ -197,8 +199,25 @@ class CampaignVariablesController extends Controller
$dictionary_campaign->update([ $dictionary_campaign->update([
'updated_need' => Carbon::now(), 'updated_need' => Carbon::now(),
]); ]);
$dictionary_campaign->groups()->forExternal()->update([
$dictionary_campaign->groups()->update([ 'updated_need' => Carbon::now(),
]);
$dictionary_campaign->goalAdvertisements()->forExternal()->update([
'updated_need' => Carbon::now(),
]);
$dictionary_campaign->goalKeywords()->forExternal()->update([
'updated_need' => Carbon::now(),
]);
$dictionary_campaign->goalGoalSitelink()->forExternal()->update([
'updated_need' => Carbon::now(),
]);
$dictionary_campaign->goalVCards()->forExternal()->update([
'updated_need' => Carbon::now(),
]);
GoalRetargetinglist::forExternal()->update([
'updated_need' => Carbon::now(),
]);
NegativeKeywordSharedSet::forExternal()->update([
'updated_need' => Carbon::now(), 'updated_need' => Carbon::now(),
]); ]);
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace App\Models; namespace App\Models;
use App\Models\Pivots\GoalNegativeKeywordSharedSet; use App\Models\Pivots\GoalNegativeKeywordSharedSet;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
...@@ -36,6 +37,15 @@ class NegativeKeywordSharedSet extends Model ...@@ -36,6 +37,15 @@ class NegativeKeywordSharedSet extends Model
]); ]);
} }
/**
* @param Builder $query
* @return Builder
*/
public function scopeForExternal($query)
{
return $query->whereNotNull('external_id');
}
public function goalNegativeKeywordSharedSets() public function goalNegativeKeywordSharedSets()
{ {
return $this->hasMany(GoalNegativeKeywordSharedSet::class, 'negative_keyword_shared_set_id'); return $this->hasMany(GoalNegativeKeywordSharedSet::class, 'negative_keyword_shared_set_id');
......
...@@ -493,6 +493,11 @@ class DictionaryCampaign extends Pivot ...@@ -493,6 +493,11 @@ class DictionaryCampaign extends Pivot
return $this->hasMany(GoalAdvertisement::class, 'dictionary_campaign_id'); return $this->hasMany(GoalAdvertisement::class, 'dictionary_campaign_id');
} }
public function goalGoalSitelink()
{
return $this->hasManyThrough(GoalSitelink::class, GoalAdvertisement::class, 'dictionary_campaign_id', 'goal_sitelink_id');
}
public function goalAdvertisementsForNotExternalForNotReserveCreate() public function goalAdvertisementsForNotExternalForNotReserveCreate()
{ {
return $this->goalAdvertisements()->forNotExternal()->forNotReserveCreate(); return $this->goalAdvertisements()->forNotExternal()->forNotReserveCreate();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!