mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
#4908 emlak24 needs
This commit is contained in:
parent
a330fb8fae
commit
334728d424
@ -740,4 +740,21 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
|||||||
->orderBy('distance')
|
->orderBy('distance')
|
||||||
->get();
|
->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getClassifiedsByCatsIDsAndLevels($categories, $limit = 10)
|
||||||
|
{
|
||||||
|
if (is_array($categories) && count($categories)) {
|
||||||
|
return $this->getModel()
|
||||||
|
->currentAds()
|
||||||
|
->where(function ($query) use ($categories) {
|
||||||
|
foreach ($categories as $level => $categoryID) {
|
||||||
|
$query->orWhereIn("cat$level", $categoryID);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->limit($limit)
|
||||||
|
->get();
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,4 +76,6 @@ interface AdvRepositoryInterface extends EntryRepositoryInterface
|
|||||||
public function getNoImageClassifiedsReport();
|
public function getNoImageClassifiedsReport();
|
||||||
|
|
||||||
public function getClassifiedsByCoordinates($lat, $lng, $distance = 50);
|
public function getClassifiedsByCoordinates($lat, $lng, $distance = 50);
|
||||||
|
|
||||||
|
public function getClassifiedsByCatsIDsAndLevels($categories, $limit = 10);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user