Commit e51187fd by Евгений

Улучшение #20347

Синхронизация наборов минус фраз
1 parent 7758777e
...@@ -5,6 +5,7 @@ namespace App\Console\Commands; ...@@ -5,6 +5,7 @@ namespace App\Console\Commands;
use App\Models\Pivots\GoalNegativeKeywordSharedSet; use App\Models\Pivots\GoalNegativeKeywordSharedSet;
use App\Models\Tokens; use App\Models\Tokens;
use App\Service\Requests\Direct\AddNegativeKeywordSharedSets; use App\Service\Requests\Direct\AddNegativeKeywordSharedSets;
use App\Service\Requests\Direct\UpdateNegativeKeywordSharedSets;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasMany;
...@@ -64,7 +65,7 @@ class NegativeKeywordSharedSetsUpdate extends Command ...@@ -64,7 +65,7 @@ class NegativeKeywordSharedSetsUpdate extends Command
]); ]);
} }
$request = new AddNegativeKeywordSharedSets(); $request = new UpdateNegativeKeywordSharedSets();
$request->setToken($token) $request->setToken($token)
->call([ ->call([
'goalNegativeKeywordSharedSets' => $goalNegativeKeywordSharedSets, 'goalNegativeKeywordSharedSets' => $goalNegativeKeywordSharedSets,
......
...@@ -226,7 +226,10 @@ class GoalAdGroup extends Pivot ...@@ -226,7 +226,10 @@ class GoalAdGroup extends Pivot
public function goalNegativeKeywordSharedSets() public function goalNegativeKeywordSharedSets()
{ {
return $this->belongsToMany(GoalNegativeKeywordSharedSet::class, GoalAdGroupGoalNegativeKeywordSharedSet::getModel()->getTable(), 'goal_ad_group_id', 'goal_negative_keyword_shared_set_id') return $this->belongsToMany(GoalNegativeKeywordSharedSet::class,
GoalAdGroupGoalNegativeKeywordSharedSet::getModel()->getTable(),
'goal_ad_group_id',
'goal_negative_keyword_shared_set_id')
->using(GoalAdGroupGoalNegativeKeywordSharedSet::class) ->using(GoalAdGroupGoalNegativeKeywordSharedSet::class)
->withPivot(GoalAdGroupGoalNegativeKeywordSharedSet::getWithPivot()) ->withPivot(GoalAdGroupGoalNegativeKeywordSharedSet::getWithPivot())
->withTimestamps(); ->withTimestamps();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!