Commit e4f8ce02 by Vladislav

#20697 Доработка добавления модификаторов

1 parent acbda803
......@@ -46,6 +46,7 @@ class BidModifiersDelete extends Command
->join('dictionary_campaigns', 'goal_bid_modifiers.dictionary_campaign_id', '=', 'dictionary_campaigns.id')
->join('dictionaries', 'dictionary_campaigns.dictionary_id', '=', 'dictionaries.id')
->whereNotNull('goal_bid_modifiers.external_id')
->whereNull('goal_bid_modifiers.deleted_at')
->whereNotNull('bid_modifiers.deleted_at')
->where('dictionaries.token_id', $token->id)
->pluck('goal_bid_modifiers.external_id');
......
......@@ -40,6 +40,12 @@ class DeleteBidModifiers extends DirectRequest
foreach ($response['result']['DeleteResults'] as $key => $delete_result) {
if (!isset($delete_result['Id'])) {
if (isset($delete_result['Errors'][0]['Message']) && $delete_result['Errors'][0]['Message'] === 'Object not found') {
GoalBidModifier::where('external_id', $this->getParams()['SelectionCriteria']['Ids'][$key])->delete();
continue;
}
Log::debug("DeleteBidModifier, empty Id");
Log::debug($delete_result);
Log::debug($this->getParams()['SelectionCriteria']['Ids'][$key]);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!