@gian_tiaga

АмоСрм фильтрация по дополнительному полю типа дата, баг ли или апи кривой?

$range = new BaseRangeFilter();
$range->setFrom($this->from->getTimestamp())
    ->setTo($this->to->getTimestamp());

$filter = new LeadsFilter();

$filter->setStatuses($successStatusesFormatted);
$filter->setPipelineIds([$pipeline['id']]);
$filter->setResponsibleUserId($id);
$filter->setCustomFieldsValues([
    data_get($additional, 'date_finished_field') => $range,
]);
$filter->setLimit(250);


AmoCRM\Filters\LeadsFilter {#2231 ▼
  -ids: null
  -names: null
  -price: null
  -createdBy: null
  -updatedBy: null
  -responsibleUserId: array:1 [▼
    0 => 5762869
  ]
  -createdAt: null
  -updatedAt: null
  -closedAt: null
  -closestTaskAt: null
  -statuses: array:5 [▼
    0 => array:2 [▼
      "status_id" => 30188239
      "pipeline_id" => 2099032
    ]
    1 => array:2 [▼
      "status_id" => 32611630
      "pipeline_id" => 2099032
    ]
    2 => array:2 [▼
      "status_id" => 32611633
      "pipeline_id" => 2099032
    ]
    3 => array:2 [▼
      "status_id" => 32611636
      "pipeline_id" => 2099032
    ]
    4 => array:2 [▼
      "status_id" => 142
      "pipeline_id" => 2099032
    ]
  ]
  -pipelineIds: array:1 [▼
    0 => 2099032
  ]
  -customFieldsValues: array:1 [▼
    421713 => array:2 [▼
      "from" => 1622494800
      "to" => 1625086799
    ]
  ]
  -query: null
  -orderField: null
  -direction: null
  -page: 1
  -limit: 250


$leads = $this->amoService->getApiClient()->leads()->get($filter);


Есть дополнительно поле типа дата пытаюсь получить сделки отфильтрованные по нему и из 1 воронки определённых статусов.
Но возвращает все сделки по эти статусам и всё. То есть не фильтрует именно по customFieldsValues
  • Вопрос задан
  • 148 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы