src/Controller/MyTestController.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Component\Routing\Annotation\Route;
  4. use Psr\Log\LoggerInterface;
  5. use App\Services\Base\CRest;
  6. use App\Services\Base\Batch;
  7. class MyTestController
  8. {
  9.     private $web_hook 'https://b24-5zbws3.bitrix24.by/rest/1/8ot5ilkbxup82264/';
  10.     private $crest;
  11.     private $batch;
  12.     const DEAL_UNP "UF_CRM_1576488958";
  13.     const DEAL_FIELD_OF_ACTIVITY "UF_CRM_1576488994";
  14.     /**
  15.      * @Route("/test")
  16.      */
  17.     public function index(CRest $crestBatch $batch)
  18.     {
  19.         $this->batch $batch;
  20.         $this->crest $crest;
  21.         $this->crest->setWebhook($this->web_hook);
  22.         $params = ['order' => [],
  23.             'filter' => [
  24.                 'COMPANY_ID' => 206
  25.             ],
  26.             'select' => [
  27.                 'ID'
  28.             ]];
  29.         $deals $this->batch->listBatch($this->crest'crm.deal.list'$params);
  30.         dump($deals);
  31.         $fields = [
  32.             self::DEAL_UNP => '000',
  33.             self::DEAL_FIELD_OF_ACTIVITY => '000'
  34.         ];
  35.         $result $this->batch->updateBatch($this->crest$deals['total'], $deals'crm.deal.update'$fields);
  36.         dump($result);
  37.         exit();
  38.     }
  39. }