Commit 1359384c by Vladislav

#19465 Реализация синхронизации данных по РК.

1 parent 2676cf9f
......@@ -49,7 +49,7 @@ class CampaignsUpdate extends Command
},
'dictionaryCampaignsForExternalNeedUpdated.campaign'
])->where('type', '!=', Tokens::MAIN)
->first();
->get();
foreach ($tokens as $token) {
$factory = APIRequest::getInstance(API::YANDEX);
......
......@@ -30,7 +30,6 @@ class AddCampaigns extends DirectRequest
public function handle($response)
{
try {
Log::debug($response);
foreach ($response['result']['AddResults'] as $key => $add_result) {
$id = $add_result['Id'] ?? '';
......
......@@ -30,6 +30,7 @@ class UpdateCampaigns extends DirectRequest
public function handle($response)
{
try {
Log::debug($response);
foreach ($response['result']['UpdateResults'] as $key => $add_result) {
$id = $add_result['Id'] ?? '';
......@@ -69,6 +70,7 @@ class UpdateCampaigns extends DirectRequest
$list = Variable::getListVariablesByDictionaryCampaign($dictionaryCampaign);
$data = [
'Id' => $dictionaryCampaign->external_id,
'Name' => StrReplaceByVariables::getInstance($dictionaryCampaign->name, $list)->get(),
'StartDate' => Carbon::now()->format('Y-m-d'),
'TextCampaign' => [
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!