<?php
namespace App\Controller;
use Symfony\Component\Routing\Annotation\Route;
use Psr\Log\LoggerInterface;
use App\Services\Base\CRest;
use App\Services\Base\Batch;
class MyTestController
{
private $web_hook = 'https://b24-5zbws3.bitrix24.by/rest/1/8ot5ilkbxup82264/';
private $crest;
private $batch;
const DEAL_UNP = "UF_CRM_1576488958";
const DEAL_FIELD_OF_ACTIVITY = "UF_CRM_1576488994";
/**
* @Route("/test")
*/
public function index(CRest $crest, Batch $batch)
{
$this->batch = $batch;
$this->crest = $crest;
$this->crest->setWebhook($this->web_hook);
$params = ['order' => [],
'filter' => [
'COMPANY_ID' => 206
],
'select' => [
'ID'
]];
$deals = $this->batch->listBatch($this->crest, 'crm.deal.list', $params);
dump($deals);
$fields = [
self::DEAL_UNP => '000',
self::DEAL_FIELD_OF_ACTIVITY => '000'
];
$result = $this->batch->updateBatch($this->crest, $deals['total'], $deals, 'crm.deal.update', $fields);
dump($result);
exit();
}
}