2012-03-23 06:46:13 +02:00
|
|
|
|
<?php
|
2014-10-08 08:20:29 +03:00
|
|
|
|
/*
|
|
|
|
|
* LiveStreet CMS
|
|
|
|
|
* Copyright © 2013 OOO "ЛС-СОФТ"
|
|
|
|
|
*
|
|
|
|
|
* ------------------------------------------------------
|
|
|
|
|
*
|
|
|
|
|
* Official site: www.livestreetcms.com
|
|
|
|
|
* Contact e-mail: office@livestreetcms.com
|
|
|
|
|
*
|
|
|
|
|
* GNU General Public License, version 2:
|
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
|
*
|
|
|
|
|
* ------------------------------------------------------
|
|
|
|
|
*
|
|
|
|
|
* @link http://www.livestreetcms.com
|
|
|
|
|
* @copyright 2013 OOO "ЛС-СОФТ"
|
|
|
|
|
* @author Maxim Mzhelskiy <rus.engine@gmail.com>
|
|
|
|
|
*
|
|
|
|
|
*/
|
2012-03-23 06:46:13 +02:00
|
|
|
|
|
2012-06-24 10:20:49 +03:00
|
|
|
|
/**
|
|
|
|
|
* Объект маппера для работы с БД
|
|
|
|
|
*
|
2014-10-08 08:20:29 +03:00
|
|
|
|
* @package application.modules.geo
|
2012-06-24 10:20:49 +03:00
|
|
|
|
* @since 1.0
|
|
|
|
|
*/
|
2014-10-08 11:49:34 +03:00
|
|
|
|
class ModuleGeo_MapperGeo extends Mapper
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Добавляет связь объекта с гео-объектом в БД
|
|
|
|
|
*
|
|
|
|
|
* @param ModuleGeo_EntityTarget $oTarget Объект связи с владельцем
|
|
|
|
|
* @return ModuleGeo_EntityTarget|bool
|
|
|
|
|
*/
|
|
|
|
|
public function AddTarget($oTarget)
|
|
|
|
|
{
|
|
|
|
|
$sql = "INSERT INTO " . Config::Get('db.table.geo_target') . " SET ?a ";
|
|
|
|
|
if ($this->oDb->query($sql, $oTarget->_getData())) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2012-03-24 05:23:49 +02:00
|
|
|
|
|
2014-10-08 11:49:34 +03:00
|
|
|
|
/**
|
|
|
|
|
* Возвращает список связей по фильтру
|
|
|
|
|
*
|
|
|
|
|
* @param array $aFilter Фильтр
|
|
|
|
|
* @param int $iCount Возвращает количество элементов
|
|
|
|
|
* @param int $iCurrPage Номер страницы
|
|
|
|
|
* @param int $iPerPage Количество элементов на страницу
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public function GetTargets($aFilter, &$iCount, $iCurrPage, $iPerPage)
|
|
|
|
|
{
|
|
|
|
|
if (isset($aFilter['target_id']) and !is_array($aFilter['target_id'])) {
|
|
|
|
|
$aFilter['target_id'] = array($aFilter['target_id']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$sql = "SELECT
|
2012-03-23 06:46:13 +02:00
|
|
|
|
*
|
|
|
|
|
FROM
|
2014-10-08 11:49:34 +03:00
|
|
|
|
" . Config::Get('db.table.geo_target') . "
|
2012-03-23 06:46:13 +02:00
|
|
|
|
WHERE
|
|
|
|
|
1 = 1
|
|
|
|
|
{ AND geo_type = ? }
|
|
|
|
|
{ AND geo_id = ?d }
|
|
|
|
|
{ AND target_type = ? }
|
2012-03-24 05:23:49 +02:00
|
|
|
|
{ AND target_id IN ( ?a ) }
|
2012-03-23 06:46:13 +02:00
|
|
|
|
{ AND country_id = ?d }
|
|
|
|
|
{ AND region_id = ?d }
|
|
|
|
|
{ AND city_id = ?d }
|
2012-04-13 03:54:24 +03:00
|
|
|
|
ORDER BY target_id DESC
|
2012-03-23 06:46:13 +02:00
|
|
|
|
LIMIT ?d, ?d ;
|
|
|
|
|
";
|
2014-10-08 11:49:34 +03:00
|
|
|
|
$aResult = array();
|
|
|
|
|
if ($aRows = $this->oDb->selectPage($iCount, $sql,
|
|
|
|
|
isset($aFilter['geo_type']) ? $aFilter['geo_type'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['geo_id']) ? $aFilter['geo_id'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['target_type']) ? $aFilter['target_type'] : DBSIMPLE_SKIP,
|
|
|
|
|
(isset($aFilter['target_id']) and count($aFilter['target_id'])) ? $aFilter['target_id'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['country_id']) ? $aFilter['country_id'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['region_id']) ? $aFilter['region_id'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['city_id']) ? $aFilter['city_id'] : DBSIMPLE_SKIP,
|
|
|
|
|
|
|
|
|
|
($iCurrPage - 1) * $iPerPage, $iPerPage
|
|
|
|
|
)
|
|
|
|
|
) {
|
|
|
|
|
foreach ($aRows as $aRow) {
|
|
|
|
|
$aResult[] = Engine::GetEntity('ModuleGeo_EntityTarget', $aRow);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return $aResult;
|
|
|
|
|
}
|
2012-03-23 06:46:13 +02:00
|
|
|
|
|
2014-10-08 11:49:34 +03:00
|
|
|
|
/**
|
|
|
|
|
* Возвращает список стран сгруппированных по количеству использований в данном типе объектов
|
|
|
|
|
*
|
|
|
|
|
* @param string $sTargetType Тип владельца
|
|
|
|
|
* @param int $iLimit Количество элементов
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public function GetGroupCountriesByTargetType($sTargetType, $iLimit)
|
|
|
|
|
{
|
|
|
|
|
$sql = "
|
2012-03-23 13:59:55 +02:00
|
|
|
|
SELECT
|
|
|
|
|
t.count,
|
|
|
|
|
g.*
|
|
|
|
|
FROM (
|
|
|
|
|
SELECT
|
|
|
|
|
count(*) as count,
|
|
|
|
|
country_id
|
|
|
|
|
FROM
|
2014-10-08 11:49:34 +03:00
|
|
|
|
" . Config::Get('db.table.geo_target') . "
|
2012-03-23 13:59:55 +02:00
|
|
|
|
WHERE target_type = ? and country_id IS NOT NULL
|
|
|
|
|
GROUP BY country_id ORDER BY count DESC LIMIT 0, ?d
|
|
|
|
|
) as t
|
2014-10-08 11:49:34 +03:00
|
|
|
|
JOIN " . Config::Get('db.table.geo_country') . " as g on t.country_id=g.id
|
2012-03-23 13:59:55 +02:00
|
|
|
|
ORDER BY g.name_ru
|
|
|
|
|
";
|
2014-10-08 11:49:34 +03:00
|
|
|
|
$aResult = array();
|
|
|
|
|
if ($aRows = $this->oDb->select($sql, $sTargetType, $iLimit)) {
|
|
|
|
|
foreach ($aRows as $aRow) {
|
|
|
|
|
$aResult[] = Engine::GetEntity('ModuleGeo_EntityCountry', $aRow);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return $aResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Возвращает список городов сгруппированных по количеству использований в данном типе объектов
|
|
|
|
|
*
|
|
|
|
|
* @param string $sTargetType Тип владельца
|
|
|
|
|
* @param int $iLimit Количество элементов
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public function GetGroupCitiesByTargetType($sTargetType, $iLimit)
|
|
|
|
|
{
|
|
|
|
|
$sql = "
|
2012-03-23 13:59:55 +02:00
|
|
|
|
SELECT
|
|
|
|
|
t.count,
|
|
|
|
|
g.*
|
|
|
|
|
FROM (
|
|
|
|
|
SELECT
|
|
|
|
|
count(*) as count,
|
|
|
|
|
city_id
|
|
|
|
|
FROM
|
2014-10-08 11:49:34 +03:00
|
|
|
|
" . Config::Get('db.table.geo_target') . "
|
2012-03-23 13:59:55 +02:00
|
|
|
|
WHERE target_type = ? and city_id IS NOT NULL
|
|
|
|
|
GROUP BY city_id ORDER BY count DESC LIMIT 0, ?d
|
|
|
|
|
) as t
|
2014-10-08 11:49:34 +03:00
|
|
|
|
JOIN " . Config::Get('db.table.geo_city') . " as g on t.city_id=g.id
|
2012-03-23 13:59:55 +02:00
|
|
|
|
ORDER BY g.name_ru
|
|
|
|
|
";
|
2014-10-08 11:49:34 +03:00
|
|
|
|
$aResult = array();
|
|
|
|
|
if ($aRows = $this->oDb->select($sql, $sTargetType, $iLimit)) {
|
|
|
|
|
foreach ($aRows as $aRow) {
|
|
|
|
|
$aResult[] = Engine::GetEntity('ModuleGeo_EntityCity', $aRow);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return $aResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Удаляет связи по фильтру
|
|
|
|
|
*
|
|
|
|
|
* @param array $aFilter Фильтр
|
|
|
|
|
* @return bool|int
|
|
|
|
|
*/
|
|
|
|
|
public function DeleteTargets($aFilter)
|
|
|
|
|
{
|
|
|
|
|
if (!$aFilter) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
$sql = "DELETE
|
2012-03-23 06:46:13 +02:00
|
|
|
|
FROM
|
2014-10-08 11:49:34 +03:00
|
|
|
|
" . Config::Get('db.table.geo_target') . "
|
2012-03-23 06:46:13 +02:00
|
|
|
|
WHERE
|
|
|
|
|
1 = 1
|
|
|
|
|
{ AND geo_type = ? }
|
|
|
|
|
{ AND geo_id = ?d }
|
|
|
|
|
{ AND target_type = ? }
|
|
|
|
|
{ AND target_id = ?d }
|
|
|
|
|
{ AND country_id = ?d }
|
|
|
|
|
{ AND region_id = ?d }
|
|
|
|
|
{ AND city_id = ?d }
|
|
|
|
|
";
|
2014-10-08 11:49:34 +03:00
|
|
|
|
$res = $this->oDb->query($sql,
|
|
|
|
|
isset($aFilter['geo_type']) ? $aFilter['geo_type'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['geo_id']) ? $aFilter['geo_id'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['target_type']) ? $aFilter['target_type'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['target_id']) ? $aFilter['target_id'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['country_id']) ? $aFilter['country_id'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['region_id']) ? $aFilter['region_id'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['city_id']) ? $aFilter['city_id'] : DBSIMPLE_SKIP
|
|
|
|
|
);
|
|
|
|
|
return $this->IsSuccessful($res);
|
|
|
|
|
}
|
2012-03-23 06:46:13 +02:00
|
|
|
|
|
2014-10-08 11:49:34 +03:00
|
|
|
|
/**
|
|
|
|
|
* Возвращает список стран по фильтру
|
|
|
|
|
*
|
|
|
|
|
* @param array $aFilter Фильтр
|
|
|
|
|
* @param array $aOrder Сортировка
|
|
|
|
|
* @param int $iCount Возвращает количество элементов
|
|
|
|
|
* @param int $iCurrPage Номер страницы
|
|
|
|
|
* @param int $iPerPage Количество элементов на страницу
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public function GetCountries($aFilter, $aOrder, &$iCount, $iCurrPage, $iPerPage)
|
|
|
|
|
{
|
|
|
|
|
$aOrderAllow = array('id', 'name_ru', 'name_en', 'sort');
|
|
|
|
|
$sOrder = '';
|
|
|
|
|
foreach ($aOrder as $key => $value) {
|
|
|
|
|
if (!in_array($key, $aOrderAllow)) {
|
|
|
|
|
unset($aOrder[$key]);
|
|
|
|
|
} elseif (in_array($value, array('asc', 'desc'))) {
|
|
|
|
|
$sOrder .= " {$key} {$value},";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$sOrder = trim($sOrder, ',');
|
|
|
|
|
if ($sOrder == '') {
|
|
|
|
|
$sOrder = ' id desc ';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$sql = "SELECT
|
2012-03-23 06:46:13 +02:00
|
|
|
|
*
|
|
|
|
|
FROM
|
2014-10-08 11:49:34 +03:00
|
|
|
|
" . Config::Get('db.table.geo_country') . "
|
2012-03-23 06:46:13 +02:00
|
|
|
|
WHERE
|
|
|
|
|
1 = 1
|
|
|
|
|
{ AND id = ?d }
|
|
|
|
|
{ AND name_ru = ? }
|
|
|
|
|
{ AND name_ru LIKE ? }
|
|
|
|
|
{ AND name_en = ? }
|
|
|
|
|
{ AND name_en LIKE ? }
|
|
|
|
|
{ AND code = ? }
|
|
|
|
|
|
|
|
|
|
ORDER by {$sOrder}
|
|
|
|
|
LIMIT ?d, ?d ;
|
|
|
|
|
";
|
2014-10-08 11:49:34 +03:00
|
|
|
|
$aResult = array();
|
|
|
|
|
if ($aRows = $this->oDb->selectPage($iCount, $sql,
|
|
|
|
|
isset($aFilter['id']) ? $aFilter['id'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['name_ru']) ? $aFilter['name_ru'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['name_ru_like']) ? $aFilter['name_ru_like'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['name_en']) ? $aFilter['name_en'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['name_en_like']) ? $aFilter['name_en_like'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['code']) ? $aFilter['code'] : DBSIMPLE_SKIP,
|
|
|
|
|
($iCurrPage - 1) * $iPerPage, $iPerPage
|
|
|
|
|
)
|
|
|
|
|
) {
|
|
|
|
|
foreach ($aRows as $aRow) {
|
|
|
|
|
$aResult[] = Engine::GetEntity('ModuleGeo_EntityCountry', $aRow);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return $aResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Возвращает список стран по фильтру
|
|
|
|
|
*
|
|
|
|
|
* @param array $aFilter Фильтр
|
|
|
|
|
* @param array $aOrder Сортировка
|
|
|
|
|
* @param int $iCount Возвращает количество элементов
|
|
|
|
|
* @param int $iCurrPage Номер страницы
|
|
|
|
|
* @param int $iPerPage Количество элементов на страницу
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public function GetRegions($aFilter, $aOrder, &$iCount, $iCurrPage, $iPerPage)
|
|
|
|
|
{
|
|
|
|
|
$aOrderAllow = array('id', 'name_ru', 'name_en', 'sort', 'country_id');
|
|
|
|
|
$sOrder = '';
|
|
|
|
|
foreach ($aOrder as $key => $value) {
|
|
|
|
|
if (!in_array($key, $aOrderAllow)) {
|
|
|
|
|
unset($aOrder[$key]);
|
|
|
|
|
} elseif (in_array($value, array('asc', 'desc'))) {
|
|
|
|
|
$sOrder .= " {$key} {$value},";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$sOrder = trim($sOrder, ',');
|
|
|
|
|
if ($sOrder == '') {
|
|
|
|
|
$sOrder = ' id desc ';
|
|
|
|
|
}
|
2012-03-23 06:46:13 +02:00
|
|
|
|
|
2014-10-08 11:49:34 +03:00
|
|
|
|
if (isset($aFilter['country_id']) and !is_array($aFilter['country_id'])) {
|
|
|
|
|
$aFilter['country_id'] = array($aFilter['country_id']);
|
|
|
|
|
}
|
2012-03-23 06:46:13 +02:00
|
|
|
|
|
2014-10-08 11:49:34 +03:00
|
|
|
|
$sql = "SELECT
|
2012-03-23 06:46:13 +02:00
|
|
|
|
*
|
|
|
|
|
FROM
|
2014-10-08 11:49:34 +03:00
|
|
|
|
" . Config::Get('db.table.geo_region') . "
|
2012-03-23 06:46:13 +02:00
|
|
|
|
WHERE
|
|
|
|
|
1 = 1
|
|
|
|
|
{ AND id = ?d }
|
|
|
|
|
{ AND name_ru = ? }
|
|
|
|
|
{ AND name_ru LIKE ? }
|
|
|
|
|
{ AND name_en = ? }
|
|
|
|
|
{ AND name_en LIKE ? }
|
|
|
|
|
{ AND country_id IN ( ?a ) }
|
|
|
|
|
|
|
|
|
|
ORDER by {$sOrder}
|
|
|
|
|
LIMIT ?d, ?d ;
|
|
|
|
|
";
|
2014-10-08 11:49:34 +03:00
|
|
|
|
$aResult = array();
|
|
|
|
|
if ($aRows = $this->oDb->selectPage($iCount, $sql,
|
|
|
|
|
isset($aFilter['id']) ? $aFilter['id'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['name_ru']) ? $aFilter['name_ru'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['name_ru_like']) ? $aFilter['name_ru_like'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['name_en']) ? $aFilter['name_en'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['name_en_like']) ? $aFilter['name_en_like'] : DBSIMPLE_SKIP,
|
|
|
|
|
(isset($aFilter['country_id']) && count($aFilter['country_id'])) ? $aFilter['country_id'] : DBSIMPLE_SKIP,
|
|
|
|
|
($iCurrPage - 1) * $iPerPage, $iPerPage
|
|
|
|
|
)
|
|
|
|
|
) {
|
|
|
|
|
foreach ($aRows as $aRow) {
|
|
|
|
|
$aResult[] = Engine::GetEntity('ModuleGeo_EntityRegion', $aRow);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return $aResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Возвращает список стран по фильтру
|
|
|
|
|
*
|
|
|
|
|
* @param array $aFilter Фильтр
|
|
|
|
|
* @param array $aOrder Сортировка
|
|
|
|
|
* @param int $iCount Возвращает количество элементов
|
|
|
|
|
* @param int $iCurrPage Номер страницы
|
|
|
|
|
* @param int $iPerPage Количество элементов на страницу
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public function GetCities($aFilter, $aOrder, &$iCount, $iCurrPage, $iPerPage)
|
|
|
|
|
{
|
|
|
|
|
$aOrderAllow = array('id', 'name_ru', 'name_en', 'sort', 'country_id', 'region_id');
|
|
|
|
|
$sOrder = '';
|
|
|
|
|
foreach ($aOrder as $key => $value) {
|
|
|
|
|
if (!in_array($key, $aOrderAllow)) {
|
|
|
|
|
unset($aOrder[$key]);
|
|
|
|
|
} elseif (in_array($value, array('asc', 'desc'))) {
|
|
|
|
|
$sOrder .= " {$key} {$value},";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$sOrder = trim($sOrder, ',');
|
|
|
|
|
if ($sOrder == '') {
|
|
|
|
|
$sOrder = ' id desc ';
|
|
|
|
|
}
|
2012-03-23 06:46:13 +02:00
|
|
|
|
|
2014-10-08 11:49:34 +03:00
|
|
|
|
if (isset($aFilter['country_id']) and !is_array($aFilter['country_id'])) {
|
|
|
|
|
$aFilter['country_id'] = array($aFilter['country_id']);
|
|
|
|
|
}
|
|
|
|
|
if (isset($aFilter['region_id']) and !is_array($aFilter['region_id'])) {
|
|
|
|
|
$aFilter['region_id'] = array($aFilter['region_id']);
|
|
|
|
|
}
|
2012-03-23 06:46:13 +02:00
|
|
|
|
|
2014-10-08 11:49:34 +03:00
|
|
|
|
$sql = "SELECT
|
2012-03-23 06:46:13 +02:00
|
|
|
|
*
|
|
|
|
|
FROM
|
2014-10-08 11:49:34 +03:00
|
|
|
|
" . Config::Get('db.table.geo_city') . "
|
2012-03-23 06:46:13 +02:00
|
|
|
|
WHERE
|
|
|
|
|
1 = 1
|
|
|
|
|
{ AND id = ?d }
|
|
|
|
|
{ AND name_ru = ? }
|
|
|
|
|
{ AND name_ru LIKE ? }
|
|
|
|
|
{ AND name_en = ? }
|
|
|
|
|
{ AND name_en LIKE ? }
|
|
|
|
|
{ AND country_id IN ( ?a ) }
|
|
|
|
|
{ AND region_id IN ( ?a ) }
|
|
|
|
|
|
|
|
|
|
ORDER by {$sOrder}
|
|
|
|
|
LIMIT ?d, ?d ;
|
|
|
|
|
";
|
2014-10-08 11:49:34 +03:00
|
|
|
|
$aResult = array();
|
|
|
|
|
if ($aRows = $this->oDb->selectPage($iCount, $sql,
|
|
|
|
|
isset($aFilter['id']) ? $aFilter['id'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['name_ru']) ? $aFilter['name_ru'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['name_ru_like']) ? $aFilter['name_ru_like'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['name_en']) ? $aFilter['name_en'] : DBSIMPLE_SKIP,
|
|
|
|
|
isset($aFilter['name_en_like']) ? $aFilter['name_en_like'] : DBSIMPLE_SKIP,
|
|
|
|
|
(isset($aFilter['country_id']) && count($aFilter['country_id'])) ? $aFilter['country_id'] : DBSIMPLE_SKIP,
|
|
|
|
|
(isset($aFilter['region_id']) && count($aFilter['region_id'])) ? $aFilter['region_id'] : DBSIMPLE_SKIP,
|
|
|
|
|
($iCurrPage - 1) * $iPerPage, $iPerPage
|
|
|
|
|
)
|
|
|
|
|
) {
|
|
|
|
|
foreach ($aRows as $aRow) {
|
|
|
|
|
$aResult[] = Engine::GetEntity('ModuleGeo_EntityCity', $aRow);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return $aResult;
|
|
|
|
|
}
|
2014-05-28 08:37:30 +03:00
|
|
|
|
}
|