- Модуль: sale
- Путь к файлу: ~/bitrix/modules/sale/lib/exchange/integration/controller/stepper.php
- Класс: BitrixSaleExchangeIntegrationControllerStepper
- Вызов: Stepper::activityBatchAction
public function activityBatchAction(array $list, $total=0, $start=0)
{
$batch = array_slice($list, 0, static::BATCH_LENGTH, true);
$slice = array_slice($list, static::BATCH_LENGTH, null, true);
$start += count($batch);
$b = $this->getUnprocessedItems($batch);
$batch = $b->getData();
foreach (array_keys($batch) as $orderId)
{
OrderTable::update($orderId, ['IS_SYNC_B24' => 'Y']);
}
$result['progress'] = round((100*$start)/$total);
$result['process'] = [
'items' => $batch,
'list' => $slice,
'total' => $total,
'start' => $start
];
if($start == $total)
{
$result['finish'] = true;
}
if(count($b->getErrorMessages())>0)
{
$result['error'] = implode("
", $b->getErrorMessages());
}
return $result;
}