...Человеческий поиск в разработке...
- Модуль: sender
- Путь к файлу: ~/bitrix/modules/sender/lib/integration/crm/returncustomer/transportbase.php
- Класс: Bitrix\Sender\Integration\Crm\ReturnCustomer\TransportBase
- Вызов: TransportBase::getLastDealCategoryId
protected function getLastDealCategoryId(EntityManageFacility $facility) { $categoryId = null; $categoryFilters = []; if ($facility->getSelector()->getCompanyId()) { $categoryFilters[] = [ '=COMPANY_ID' => $facility->getSelector()->getCompanyId() ]; } if ($facility->getSelector()->getContactId()) { $categoryFilters[] = [ '=CONTACT_ID' => $facility->getSelector()->getContactId() ]; } foreach ($categoryFilters as $categoryFilter) { $categoryFilter['=STAGE_SEMANTIC_ID'] = [ PhaseSemantics::PROCESS, PhaseSemantics::SUCCESS ]; $dealRow = DealTable::getRow([ 'select' => ['CATEGORY_ID'], 'filter' => $categoryFilter, 'limit' => 1, 'order' => ['DATE_CREATE' => 'DESC'] ]); if (!$dealRow) { break; } $categoryId = $dealRow['CATEGORY_ID']; } return $categoryId; }