- Модуль: tasks
- Путь к файлу: ~/bitrix/modules/tasks/lib/internals/counter/processor/userprocessor.php
- Класс: BitrixTasksInternalsCounterProcessorUserProcessor
- Вызов: UserProcessor::crossTypeReset
private function crossTypeReset(array $types, array $coverTypes, array $groupIds = []): void
{
$sql = "
DELETE ts1.*
FROM ". CounterTable::getTableName(). " ts1
INNER JOIN b_tasks_scorer ts2
ON ts2.TASK_ID = ts1.TASK_ID
AND ts2.USER_ID = {$this->userId}
AND ts2.`TYPE` IN ('". implode("','", $types) ."')
WHERE
ts1.USER_ID = {$this->userId}
AND ts1.`TYPE` IN ('". implode("','", $coverTypes) ."')
";
if (!empty($groupIds))
{
$sql .= "AND ts1.GROUP_ID IN (". implode(",", $groupIds) .")";
}
Application::getConnection()->query($sql);
}