示例#1
0
文件: VeraParser.php 项目: Quiss/Oon
 /**
  * @Route("/parserVera/6")
  */
 public function parserVera6Action($hot = false)
 {
     $em = $this->em;
     $company = $em->getRepository('AppBundle:Company')->findOneByTitle('Вера Олимп');
     if ($company == null) {
         $company = new Company();
         $company->setTitle('Вера Олимп');
         $em->persist($company);
         $em->flush($company);
         $em->refresh($company);
     }
     $phpExcelObject = $this->container->get('phpexcel')->createPHPExcelObject($this->filePath);
     $num = 11;
     $city = $em->getRepository('AppBundle:City')->findOneById(2);
     while (true) {
         if ($phpExcelObject->setActiveSheetIndex(5)->getCell('A' . $num)->getValue() == '') {
             break;
         }
         $banner = new Banner();
         $banner->setCompany($company);
         $banner->setAdrs(explode("\n", $phpExcelObject->setActiveSheetIndex(5)->getCell('B' . $num)->getValue())[0]);
         $banner->setTitle(explode("\n", $phpExcelObject->setActiveSheetIndex(5)->getCell('B' . $num)->getValue())[0]);
         $banner->setBody($phpExcelObject->setActiveSheetIndex(5)->getCell('B' . $num)->getValue());
         $banner->setSide($phpExcelObject->setActiveSheetIndex(5)->getCell('R' . $num)->getValue());
         $banner->setCity($city);
         $banner->setGrp(str_replace(',', '.', $phpExcelObject->setActiveSheetIndex(5)->getCell('E' . $num)->getValue()));
         $banner->setGid($phpExcelObject->setActiveSheetIndex(5)->getCell('F' . $num)->getValue());
         $banner->setOts(str_replace(',', '.', $phpExcelObject->setActiveSheetIndex(5)->getCell('M' . $num)->getValue()));
         $banner->setPrice(str_replace(array(',', ''), array('.', ''), $phpExcelObject->setActiveSheetIndex(5)->getCell('G' . $num)->getValue()));
         $banner->setPrice2(str_replace(array(',', ''), array('.', ''), $phpExcelObject->setActiveSheetIndex(5)->getCell('G' . $num)->getValue() * 1.18));
         $banner->setTaxType('НДС (18%)');
         $banner->setPriceDeploy(str_replace(array(',', ' '), array('.', ''), $phpExcelObject->setActiveSheetIndex(5)->getCell('Q' . $num)->getValue()));
         $banner->setFormat('3x6');
         $banner->setType($phpExcelObject->setActiveSheetIndex(5)->getCell('O' . $num)->getValue());
         $banner->setArea(null);
         $banner->setLight($phpExcelObject->setActiveSheetIndex(5)->getCell('N' . $num)->getValue() == 'Да' || $phpExcelObject->setActiveSheetIndex(5)->getCell('N' . $num)->getValue() == 'да' ? 1 : 0);
         $banner->setImg(null);
         $banner->setLink($phpExcelObject->setActiveSheetIndex(5)->getCell('J' . $num)->getHyperlink()->getUrl());
         //            $pos = $this->getPosition($phpExcelObject->setActiveSheetIndex(5)->getCell('R'.$num)->getValue());
         //            $banner->setLongitude($pos[1]);
         //            $banner->setLatitude($pos[0]);
         //            if ($hot){
         //                $banner->setHot(true);
         //            }else{
         $banner->setHot(true);
         //            }
         $banner2 = $em->getRepository('AppBundle:Banner2')->findOneByTitle($banner->getTitle());
         if ($banner2) {
             $banner->setLatitude($banner2->getLatitude());
             $banner->setLongitude($banner2->getLongitude());
         } else {
             $banner->setLatitude(0);
             $banner->setLongitude(0);
         }
         $em->persist($banner);
         $em->flush($banner);
         $num++;
     }
     return true;
 }
示例#2
0
 public function parserGellary3Action($hot = false)
 {
     //        $this->filePath = $this->filePath.'G2.XLSX';
     $em = $this->em;
     $company = $em->getRepository('AppBundle:Company')->findOneByTitle('Gallery  roller');
     if ($company == null) {
         $company = new Company();
         $company->setTitle('Gallery roller');
         $em->persist($company);
         $em->flush($company);
         $em->refresh($company);
     }
     $phpExcelObject = $this->container->get('phpexcel')->createPHPExcelObject($this->filePath);
     $num = 2;
     while (true) {
         if ($phpExcelObject->setActiveSheetIndex(0)->getCell('B' . $num)->getValue() == '') {
             break;
         }
         $banner = new Banner();
         $banner->setCompany($company);
         $banner->setAdrs($phpExcelObject->setActiveSheetIndex(0)->getCell('E' . $num)->getValue());
         $banner->setTitle($phpExcelObject->setActiveSheetIndex(0)->getCell('E' . $num)->getValue());
         $banner->setBody($phpExcelObject->setActiveSheetIndex(0)->getCell('E' . $num)->getValue());
         $banner->setSide($this->getSide($phpExcelObject->setActiveSheetIndex(0)->getCell('D' . $num)->getValue()));
         $city = $this->em->getRepository('AppBundle:City')->findOneByTitle($phpExcelObject->setActiveSheetIndex(0)->getCell('A' . $num)->getValue());
         if ($city == null) {
             $city = new City();
             $city->setTitle($phpExcelObject->setActiveSheetIndex(0)->getCell('A' . $num)->getValue());
             $em->persist($city);
             $em->flush($city);
             $em->refresh($city);
         }
         $banner->setCity($city);
         $banner->setGid($phpExcelObject->setActiveSheetIndex(0)->getCell('N' . $num)->getValue());
         $banner->setGrp(str_replace(',', '.', $phpExcelObject->setActiveSheetIndex(0)->getCell('L' . $num)->getValue()));
         $banner->setOts(str_replace(',', '.', $phpExcelObject->setActiveSheetIndex(0)->getCell('M' . $num)->getValue()));
         $banner->setPrice(str_replace(array(',', ''), array('.', ''), $phpExcelObject->setActiveSheetIndex(0)->getCell('J' . $num)->getValue()));
         $banner->setPrice2(str_replace(array(',', ''), array('.', ''), $phpExcelObject->setActiveSheetIndex(0)->getCell('I' . $num)->getValue()));
         $banner->setPriceDeploy(0);
         $banner->setTaxType('НДС (18%)');
         $banner->setFormat('small');
         $banner->setType($phpExcelObject->setActiveSheetIndex(0)->getCell('B' . $num)->getValue());
         $banner->setArea($phpExcelObject->setActiveSheetIndex(0)->getCell('W' . $num)->getValue());
         $banner->setLight($phpExcelObject->setActiveSheetIndex(0)->getCell('C' . $num)->getValue() == 'Да' || $phpExcelObject->setActiveSheetIndex(0)->getCell('C' . $num)->getValue() == 'да' ? 1 : 0);
         $banner->setImg($this->getImage($phpExcelObject->setActiveSheetIndex(0)->getCell('G' . $num)->getHyperlink()->getUrl()));
         $banner->setLink($phpExcelObject->setActiveSheetIndex(0)->getCell('G' . $num)->getHyperlink()->getUrl());
         if ($hot) {
             $banner->setHot(true);
         } else {
             $banner->setHot(false);
         }
         $url = 'http://geocode-maps.yandex.ru/1.x/?geocode=' . urlencode($phpExcelObject->setActiveSheetIndex(0)->getCell('E' . $num)->getValue());
         $content = file_get_contents($url);
         $XmlObj = simplexml_load_string($content);
         if (isset($XmlObj->GeoObjectCollection->featureMember->GeoObject->Point->pos)) {
             $pos['x'] = explode(' ', $XmlObj->GeoObjectCollection->featureMember->GeoObject->Point->pos)[1];
             $pos['y'] = explode(' ', $XmlObj->GeoObjectCollection->featureMember->GeoObject->Point->pos)[0];
         } else {
             $pos['x'] = 0;
             $pos['y'] = 0;
         }
         $banner->setLongitude($pos['y']);
         $banner->setLatitude($pos['x']);
         $banner = $this->setBanner($banner);
         $month = array('2015-06-01' => $this->getStatus($phpExcelObject->setActiveSheetIndex(0)->getStyle('O' . $num)->getFill()->getStartColor()->getRGB()), '2015-07-01' => $this->getStatus($phpExcelObject->setActiveSheetIndex(0)->getStyle('P' . $num)->getFill()->getStartColor()->getRGB()), '2015-08-01' => $this->getStatus($phpExcelObject->setActiveSheetIndex(0)->getStyle('Q' . $num)->getFill()->getStartColor()->getRGB()), '2015-09-01' => $this->getStatus($phpExcelObject->setActiveSheetIndex(0)->getStyle('R' . $num)->getFill()->getStartColor()->getRGB()), '2015-10-01' => $this->getStatus($phpExcelObject->setActiveSheetIndex(0)->getStyle('S' . $num)->getFill()->getStartColor()->getRGB()), '2015-11-01' => $this->getStatus($phpExcelObject->setActiveSheetIndex(0)->getStyle('T' . $num)->getFill()->getStartColor()->getRGB()), '2015-12-01' => $this->getStatus($phpExcelObject->setActiveSheetIndex(0)->getStyle('U' . $num)->getFill()->getStartColor()->getRGB()));
         $this->refreshStatus($banner, $month, array('date' => '2015-06-01', 'sale' => $hot));
         $num++;
         if ($num % 50 == 0) {
             sleep(rand(1, 5));
         }
     }
     return true;
 }
示例#3
0
 /**
  * @Route("/parserVera/6")
  */
 public function parserVera6Action()
 {
     $em = $this->getDoctrine()->getManager();
     $company = $em->getRepository('AppBundle:Company')->findOneByTitle('Вера Олимп');
     if ($company == null) {
         $company = new Company();
         $company->setTitle('Вера Олимп');
         $em->persist($company);
         $em->flush($company);
         $em->refresh($company);
     }
     $phpExcelObject = $this->get('phpexcel')->createPHPExcelObject($this->filePath);
     $num = 11;
     while (true) {
         if ($phpExcelObject->setActiveSheetIndex(4)->getCell('A' . $num)->getValue() == '') {
             break;
         }
         $banner = new Banner();
         $banner->setCompany($company);
         $banner->setAdrs(explode("\n", $phpExcelObject->setActiveSheetIndex(4)->getCell('B' . $num)->getValue())[0]);
         $banner->setTitle(explode("\n", $phpExcelObject->setActiveSheetIndex(4)->getCell('B' . $num)->getValue())[0]);
         $banner->setBody($phpExcelObject->setActiveSheetIndex(4)->getCell('B' . $num)->getValue());
         $banner->setSide($phpExcelObject->setActiveSheetIndex(4)->getCell('C' . $num)->getValue());
         $banner->setCity('Московская область');
         $banner->setGrp(str_replace(',', '.', $phpExcelObject->setActiveSheetIndex(4)->getCell('E' . $num)->getValue()));
         $banner->setGid($phpExcelObject->setActiveSheetIndex(4)->getCell('F' . $num)->getValue());
         $banner->setPrice(str_replace(array(',', ''), array('.', ''), $phpExcelObject->setActiveSheetIndex(4)->getCell('G' . $num)->getValue()));
         $banner->setPrice2(str_replace(array(',', ''), array('.', ''), $phpExcelObject->setActiveSheetIndex(4)->getCell('G' . $num)->getValue()) * 1.18);
         $banner->setTaxType('НДС (18%)');
         $banner->setOts(str_replace(',', '.', $phpExcelObject->setActiveSheetIndex(4)->getCell('M' . $num)->getValue()));
         $banner->setFormat('3x6');
         $banner->setType($phpExcelObject->setActiveSheetIndex(4)->getCell('N' . $num)->getValue());
         $banner->setArea(null);
         $banner->setLight($phpExcelObject->setActiveSheetIndex(4)->getCell('Q' . $num)->getValue() == 'Да' || $phpExcelObject->setActiveSheetIndex(4)->getCell('Q' . $num)->getValue() == 'да' ? 1 : 0);
         $banner->setImg(null);
         $banner->setLink($phpExcelObject->setActiveSheetIndex(0)->getCell('J' . $num)->getHyperlink()->getUrl());
         $pos = $this->getPosition($phpExcelObject->setActiveSheetIndex(4)->getCell('R' . $num)->getValue());
         $banner->setLongitude($pos[1]);
         $banner->setLatitude($pos[0]);
         $em->persist($banner);
         $em->flush($banner);
         $num++;
     }
     return new Response('открылось');
 }
示例#4
0
 /**
  * @Route("/parserGellary/2")
  */
 public function parserGellary2Action()
 {
     $this->filePath = $this->filePath . 'G2.XLSX';
     $em = $this->getDoctrine()->getManager();
     $company = $em->getRepository('AppBundle:Company')->findOneByTitle('Gallery');
     if ($company == null) {
         $company = new Company();
         $company->setTitle('Gallery');
         $em->persist($company);
         $em->flush($company);
         $em->refresh($company);
     }
     $phpExcelObject = $this->get('phpexcel')->createPHPExcelObject($this->filePath);
     $num = 11;
     while (true) {
         if ($phpExcelObject->setActiveSheetIndex(0)->getCell('B' . $num)->getValue() == '') {
             break;
         }
         $banner = new Banner();
         $banner->setCompany($company);
         $banner->setAdrs($phpExcelObject->setActiveSheetIndex(0)->getCell('E' . $num)->getValue());
         $banner->setTitle($phpExcelObject->setActiveSheetIndex(0)->getCell('E' . $num)->getValue());
         $banner->setBody($phpExcelObject->setActiveSheetIndex(0)->getCell('E' . $num)->getValue());
         $banner->setSide($this->getSide($phpExcelObject->setActiveSheetIndex(0)->getCell('D' . $num)->getValue()));
         $banner->setCity($phpExcelObject->setActiveSheetIndex(0)->getCell('A' . $num)->getValue() == 'Москва' ? 'Москва' : 'Московская область');
         $banner->setGid($phpExcelObject->setActiveSheetIndex(0)->getCell('F' . $num)->getValue());
         $banner->setGrp(str_replace(',', '.', $phpExcelObject->setActiveSheetIndex(0)->getCell('K' . $num)->getValue()));
         $banner->setOts(str_replace(',', '.', $phpExcelObject->setActiveSheetIndex(0)->getCell('L' . $num)->getValue()));
         $banner->setPrice(str_replace(array(',', ''), array('.', ''), $phpExcelObject->setActiveSheetIndex(0)->getCell('J' . $num)->getValue()));
         $banner->setPrice2(str_replace(array(',', ''), array('.', ''), $phpExcelObject->setActiveSheetIndex(0)->getCell('I' . $num)->getValue()));
         $banner->setPriceDeploy(0);
         $banner->setTaxType('НДС (18%)');
         $banner->setFormat('small');
         $banner->setType($phpExcelObject->setActiveSheetIndex(0)->getCell('B' . $num)->getValue());
         $banner->setArea($phpExcelObject->setActiveSheetIndex(0)->getCell('X' . $num)->getValue());
         $banner->setLight($phpExcelObject->setActiveSheetIndex(0)->getCell('C' . $num)->getValue() == 'Да' || $phpExcelObject->setActiveSheetIndex(0)->getCell('C' . $num)->getValue() == 'да' ? 1 : 0);
         $banner->setImg($this->getImage($phpExcelObject->setActiveSheetIndex(0)->getCell('G' . $num)->getHyperlink()->getUrl()));
         $banner->setLink($phpExcelObject->setActiveSheetIndex(0)->getCell('G' . $num)->getHyperlink()->getUrl());
         $url = 'http://geocode-maps.yandex.ru/1.x/?geocode=' . urlencode($phpExcelObject->setActiveSheetIndex(0)->getCell('E' . $num)->getValue());
         $content = file_get_contents($url);
         $XmlObj = simplexml_load_string($content);
         if (isset($XmlObj->GeoObjectCollection->featureMember->GeoObject->Point->pos)) {
             $pos['x'] = explode(' ', $XmlObj->GeoObjectCollection->featureMember->GeoObject->Point->pos)[1];
             $pos['y'] = explode(' ', $XmlObj->GeoObjectCollection->featureMember->GeoObject->Point->pos)[0];
         } else {
             $pos['x'] = 0;
             $pos['y'] = 0;
         }
         $banner->setLongitude($pos['y']);
         $banner->setLatitude($pos['x']);
         $em->persist($banner);
         $em->flush($banner);
         $num++;
         if ($num % 50 == 0) {
             sleep(rand(1, 5));
         }
     }
     return new Response('открылось');
 }
示例#5
0
 /**
  * @Route("/parserRasvero/1")
  */
 public function parserRasvero1Action($hot = false)
 {
     $em = $this->em;
     $company = $em->getRepository('AppBundle:Company')->findOneByTitle('Расверо');
     if ($company == null) {
         $company = new Company();
         $company->setTitle('Расверо');
         $em->persist($company);
         $em->flush($company);
         $em->refresh($company);
     }
     $phpExcelObject = $this->container->get('phpexcel')->createPHPExcelObject($this->filePath);
     $num = 7;
     $city = $em->getRepository('AppBundle:City')->findOneById(1);
     while (true) {
         if ($phpExcelObject->setActiveSheetIndex(0)->getCell('B' . $num)->getValue() == '') {
             break;
         }
         $banner = new Banner();
         $banner->setCompany($company);
         $banner->setAdrs(explode("\n", $phpExcelObject->setActiveSheetIndex(0)->getCell('E' . $num)->getValue())[0]);
         $banner->setTitle(explode("\n", $phpExcelObject->setActiveSheetIndex(0)->getCell('E' . $num)->getValue())[0]);
         $banner->setBody($phpExcelObject->setActiveSheetIndex(0)->getCell('E' . $num)->getValue());
         $banner->setSide($phpExcelObject->setActiveSheetIndex(0)->getCell('H' . $num)->getValue());
         $banner->setCity($city);
         $banner->setGrp(str_replace(',', '.', $phpExcelObject->setActiveSheetIndex(0)->getCell('L' . $num)->getValue()));
         $banner->setOts(str_replace(',', '.', $phpExcelObject->setActiveSheetIndex(0)->getCell('M' . $num)->getValue()));
         $banner->setGid($phpExcelObject->setActiveSheetIndex(0)->getCell('K' . $num)->getValue());
         $banner->setPrice(str_replace(array(',', ''), array('.', ''), $phpExcelObject->setActiveSheetIndex(0)->getCell('R' . $num)->getValue() * 0.82));
         $banner->setPrice2(str_replace(array(',', ''), array('.', ''), $phpExcelObject->setActiveSheetIndex(0)->getCell('R' . $num)->getValue()));
         $banner->setTaxType('НДС (18%)');
         $banner->setFormat('small');
         $banner->setType($phpExcelObject->setActiveSheetIndex(0)->getCell('I' . $num)->getValue() . ' ' . $phpExcelObject->setActiveSheetIndex(0)->getCell('J' . $num)->getValue() . ' ' . ' ( ' . $phpExcelObject->setActiveSheetIndex(0)->getCell('G' . $num)->getValue() . ' ) ');
         $banner->setArea($phpExcelObject->setActiveSheetIndex(0)->getCell('F' . $num)->getValue());
         $banner->setLight(0);
         $banner->setImg($this->getPhoto($phpExcelObject->setActiveSheetIndex(0)->getCell('O' . $num)->getValue()));
         $banner->setLink(0);
         $url = $phpExcelObject->setActiveSheetIndex(0)->getCell('E' . $num)->getValue();
         $url = 'http://geocode-maps.yandex.ru/1.x/?geocode=' . urlencode($url);
         $content = file_get_contents($url);
         $XmlObj = simplexml_load_string($content);
         if (isset($XmlObj->GeoObjectCollection->featureMember->GeoObject->Point->pos)) {
             $pos['x'] = explode(' ', $XmlObj->GeoObjectCollection->featureMember->GeoObject->Point->pos)[1];
             $pos['y'] = explode(' ', $XmlObj->GeoObjectCollection->featureMember->GeoObject->Point->pos)[0];
         } else {
             $pos['x'] = 0;
             $pos['y'] = 0;
         }
         $banner->setLongitude($pos['y']);
         $banner->setLatitude($pos['x']);
         //            $banner = $this->setBanner($banner);
         //            $month = array(
         //                '2015-08-01' => $this->getStatus($phpExcelObject->setActiveSheetIndex(0)->getCell('S'.$num)->getValue()),
         //                '2015-09-01' => $this->getStatus($phpExcelObject->setActiveSheetIndex(0)->getCell('T'.$num)->getValue()),
         //                '2015-10-01' => $this->getStatus($phpExcelObject->setActiveSheetIndex(0)->getCell('U'.$num)->getValue()),
         //                '2015-11-01' => $this->getStatus($phpExcelObject->setActiveSheetIndex(0)->getCell('V'.$num)->getValue()),
         //                '2015-12-01' => $this->getStatus($phpExcelObject->setActiveSheetIndex(0)->getCell('W'.$num)->getValue()),
         ////                '2015-12-01' => $this->getStatus($phpExcelObject->setActiveSheetIndex(0)->getCell('X'.$num)->getValue()),
         ////                '2015-12-01' => $this->getStatus($phpExcelObject->setActiveSheetIndex(0)->getCell('Y'.$num)->getValue()),
         //            );
         //            $this->refreshStatus($banner,$month, array('date' => '2015-06-01' , 'sale' => $hot));
         //            if ($hot){
         //                $banner->setHot(true);
         //            }else{
         $banner->setHot(false);
         //            }
         //            if (strripos($phpExcelObject->setActiveSheetIndex(0)->getCell('S' . $num)->getValue(),'Свободно') !== false){
         //                $banner->setHot(true);
         //            }
         $this->em->persist($banner);
         $this->em->flush($banner);
         $num++;
         if ($num % 50 == 0) {
             sleep(rand(1, 5));
         }
     }
     return true;
 }
示例#6
0
 /**
  * @Route("/parserRasvero/1")
  */
 public function parserVera1Action()
 {
     $em = $this->getDoctrine()->getManager();
     $company = $em->getRepository('AppBundle:Company')->findOneByTitle('Расверо');
     if ($company == null) {
         $company = new Company();
         $company->setTitle('Расверо');
         $em->persist($company);
         $em->flush($company);
         $em->refresh($company);
     }
     $phpExcelObject = $this->get('phpexcel')->createPHPExcelObject($this->filePath);
     $num = 7;
     $city = $this->getDoctrine()->getRepository('AppBundle:City')->findOneById(1);
     while (true) {
         if ($phpExcelObject->setActiveSheetIndex(0)->getCell('B' . $num)->getValue() == '') {
             break;
         }
         $banner = new Banner();
         $banner->setCompany($company);
         $banner->setAdrs(explode("\n", $phpExcelObject->setActiveSheetIndex(0)->getCell('E' . $num)->getValue())[0]);
         $banner->setTitle(explode("\n", $phpExcelObject->setActiveSheetIndex(0)->getCell('E' . $num)->getValue())[0]);
         $banner->setBody($phpExcelObject->setActiveSheetIndex(0)->getCell('E' . $num)->getValue());
         $banner->setSide($this->getSide($phpExcelObject->setActiveSheetIndex(0)->getCell('I' . $num)->getValue()));
         $banner->setCity($city);
         $banner->setGrp(str_replace(',', '.', $phpExcelObject->setActiveSheetIndex(0)->getCell('M' . $num)->getValue()));
         $banner->setOts(str_replace(',', '.', $phpExcelObject->setActiveSheetIndex(0)->getCell('N' . $num)->getValue()));
         $banner->setGid($phpExcelObject->setActiveSheetIndex(0)->getCell('C' . $num)->getValue());
         $banner->setPrice(str_replace(array(',', ''), array('.', ''), $phpExcelObject->setActiveSheetIndex(0)->getCell('R' . $num)->getValue()));
         $banner->setPrice2(str_replace(array(',', ''), array('.', ''), $phpExcelObject->setActiveSheetIndex(0)->getCell('T' . $num)->getValue()));
         $banner->setTaxType('НДС (18%)');
         $banner->setFormat('small');
         $banner->setType($phpExcelObject->setActiveSheetIndex(0)->getCell('J' . $num)->getValue() . ' ' . $phpExcelObject->setActiveSheetIndex(0)->getCell('K' . $num)->getValue() . ' ' . ' ( ' . $phpExcelObject->setActiveSheetIndex(0)->getCell('H' . $num)->getValue() . ' ) ');
         $banner->setArea($phpExcelObject->setActiveSheetIndex(0)->getCell('G' . $num)->getValue());
         $banner->setLight(0);
         $banner->setImg($this->getPhoto($phpExcelObject->setActiveSheetIndex(0)->getCell('P' . $num)->getValue()));
         $banner->setLink(0);
         if ($phpExcelObject->setActiveSheetIndex(0)->getCell('S' . $num)->getValue() == 'Свободно') {
             $banner->setHot(true);
         }
         //            $url = substr ($phpExcelObject->setActiveSheetIndex(0)->getCell('E'.$num)->getValue(), 0, strrpos($phpExcelObject->setActiveSheetIndex(0)->getCell('E'.$num)->getValue(), '.'));
         $url = $phpExcelObject->setActiveSheetIndex(0)->getCell('E' . $num)->getValue();
         //            if ($url == ''){
         //                echo '<br /><br />'.$num;
         //                break;
         //            }
         $url = 'http://geocode-maps.yandex.ru/1.x/?geocode=' . urlencode($url);
         $content = @file_get_contents($url);
         $XmlObj = simplexml_load_string($content);
         if (isset($XmlObj->GeoObjectCollection->featureMember->GeoObject->Point->pos)) {
             $pos['x'] = explode(' ', $XmlObj->GeoObjectCollection->featureMember->GeoObject->Point->pos)[1];
             $pos['y'] = explode(' ', $XmlObj->GeoObjectCollection->featureMember->GeoObject->Point->pos)[0];
         } else {
             $pos['x'] = 0;
             $pos['y'] = 0;
         }
         $banner->setLongitude($pos['y']);
         $banner->setLatitude($pos['x']);
         $em->persist($banner);
         $em->flush($banner);
         $num++;
         if ($num % 30 == 0) {
             sleep(rand(1, 5));
         }
     }
     return new Response('открылось');
 }