...Человеческий поиск в разработке...
- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/integration/main/uiselector/crmleads.php
- Класс: Bitrix\Crm\Integration\Main\UISelector\CrmLeads
- Вызов: CrmLeads::search
public function search($params = []) { $result = [ 'ITEMS' => [], 'ADDITIONAL_INFO' => [], ]; $entityOptions = (!empty($params['options']) ? $params['options'] : []); $requestFields = (!empty($params['requestFields']) ? $params['requestFields'] : []); $search = $requestFields['searchString']; $prefix = static::getPrefix($entityOptions); if ( $search <> '' && ( empty($entityOptions['enableSearch']) || $entityOptions['enableSearch'] !== 'N' ) ) { $filter = $this->getSearchFilter($search, $entityOptions); if ($filter === false) { return $result; } $select = $this->getSearchSelect(); $res = CCrmLead::getListEx( $this->getSearchOrder(), $filter, false, ['nTopCount' => 20], $select ); $resultItems = []; while ($entityFields = $res->fetch()) { $resultItems[$prefix . $entityFields['ID']] = static::prepareEntity($entityFields, $entityOptions); } $resultItems = $this->appendItemsByIds($resultItems, $search, $entityOptions); $resultItems = $this->processResultItems($resultItems, $entityOptions); $result["ITEMS"] = $resultItems; } return $result; }