Для платных точек не выводятся точки того-же типа в блоке поблизости
This commit is contained in:
parent
90d96afb2b
commit
c92c3a83da
|
|
@ -81,8 +81,13 @@ class PointController extends Controller
|
||||||
}
|
}
|
||||||
$photoLinksRes = implode('; ', array_keys($photoLinksRes));
|
$photoLinksRes = implode('; ', array_keys($photoLinksRes));
|
||||||
|
|
||||||
|
$categoryId = 0;
|
||||||
|
if (array_search($point->categoryId, Category::$paidIds) !== FALSE) {
|
||||||
|
$categoryId = $point->categoryId;
|
||||||
|
}
|
||||||
|
|
||||||
$similarPoints = Point::model()->getAll(array('where' => '`status` = "published" AND categoryId = ' . $point->categoryId . ' AND `id` <> ' . $point->id . ' ORDER BY RAND() LIMIT 6;'));
|
$similarPoints = Point::model()->getAll(array('where' => '`status` = "published" AND categoryId = ' . $point->categoryId . ' AND `id` <> ' . $point->id . ' ORDER BY RAND() LIMIT 6;'));
|
||||||
$closestPoints = Point::model()->getClosestPoints($pointId);
|
$closestPoints = Point::model()->getClosestPoints($pointId, $categoryId);
|
||||||
$randomPoint = Point::model()->getRandom();
|
$randomPoint = Point::model()->getRandom();
|
||||||
$randomPoint->description = mb_substr($randomPoint->description, 0, 400, 'UTF-8');
|
$randomPoint->description = mb_substr($randomPoint->description, 0, 400, 'UTF-8');
|
||||||
$randomPoint->description = Helper::replaceLinks($randomPoint->description);
|
$randomPoint->description = Helper::replaceLinks($randomPoint->description);
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ class Point extends Model
|
||||||
return $this->getByPK($pointId);
|
return $this->getByPK($pointId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getClosestPoints($pointId)
|
public function getClosestPoints($pointId, $categoryNot = 0)
|
||||||
{
|
{
|
||||||
$degrees = 1;
|
$degrees = 1;
|
||||||
|
|
||||||
|
|
@ -64,6 +64,8 @@ class Point extends Model
|
||||||
WHERE
|
WHERE
|
||||||
`status` = "published"
|
`status` = "published"
|
||||||
AND
|
AND
|
||||||
|
`categoryId` != ' . $categoryNot . '
|
||||||
|
AND
|
||||||
`lat` BETWEEN :minLat AND :maxLat
|
`lat` BETWEEN :minLat AND :maxLat
|
||||||
AND
|
AND
|
||||||
`lng` BETWEEN :minLng AND :maxLng
|
`lng` BETWEEN :minLng AND :maxLng
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue