• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/location/import/compiler/compiler.php
  • Класс: BitrixSaleLocationImportCompilerCompiler
  • Вызов: Compiler::checkFiasMaps
private function checkFiasMaps()
{
	$links = $res = $this->getDataFromCSV('fias_yamarket_links', 'rootv2');
	$uTotal = 0;
	foreach($links as $reg)
	{
		if($reg['CITIES_MAPPED'] != '1')
		{
			//$this->output($reg);
			$rMap = $this->getDataFromCSV('fias_yamarket_links', 'region_'.$reg['YAMARKET']);
			
			$this->output('============================ For: '.$reg['YAMARKET_NAME'].' '.$reg['YAMARKET']);

			$unmapped = 0;
			foreach($rMap as $map)
			{
				if(!strlen($map['AOGUID']))
				{
					$unmapped++;

					$this->output($map);

					$res = DBFiasTable::getList(array('filter' => array(
						'FORMALNAME' => $map['NAME'],
						'!SHORTNAME' => array('ул', 'пер'),
						'ACTSTATUS' => '1',
						'LIVESTATUS' => '1'
					)));
					while($item = $res->fetch())
					{
						$this->output($item);
					}
				}
			}

			$this->output('Unmapped: '.$unmapped);
			$uTotal += $unmapped;
		}
	}
	$this->output('TOTAL: '.$uTotal);
}