Bitrix\Main\Loader::includeModule('sale');
$orders = Bitrix\Sale\OrderTable::getList([
'filter' => [
'PAYED' => 'Y'
],
'group' => ['USER_ID'],
'select' => ['USER_ID', 'CNT'],
'runtime' => [
new Bitrix\Main\Entity\ExpressionField('CNT', 'COUNT(*)')
]
])->fetchAll();
function collectValues(target, ...sources) {
const onInput = () => target.value = sources.map(n => n.value).join(', ');
sources.forEach(n => n.addEventListener('input', onInput));
return () => sources.forEach(n => n.removeEventListener('input', onInput));
}
collectValues(...document.querySelectorAll('input'));
const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
const expression = /[-–—]/g;
while (walker.nextNode()) {
const node = walker.currentNode;
if (expression.test(node.textContent)) {
node.textContent = node.textContent.replace(expression, '-');
}
}