mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
deactivate bookcases
This commit is contained in:
@@ -31,7 +31,7 @@ class BookCaseTable extends Component
|
||||
'icon_size' => [42, 42],
|
||||
])
|
||||
->toArray(),
|
||||
'bookCases' => BookCase::get(),
|
||||
'bookCases' => BookCase::query()->active()->get(),
|
||||
'countries' => Country::query()
|
||||
->select(['code', 'name'])
|
||||
->get(),
|
||||
|
||||
@@ -13,11 +13,13 @@ class Heatmap extends Component
|
||||
public function render()
|
||||
{
|
||||
$data = BookCase::query()
|
||||
->active()
|
||||
->whereHas('orangePills')
|
||||
->get()->map(fn($bookCase) => [
|
||||
'lat' => $bookCase->latitude,
|
||||
'lng' => $bookCase->longitude,
|
||||
]);
|
||||
->get()
|
||||
->map(fn($bookCase) => [
|
||||
'lat' => $bookCase->latitude,
|
||||
'lng' => $bookCase->longitude,
|
||||
]);
|
||||
|
||||
return view('livewire.book-case.heatmap', [
|
||||
'heatmap_data' => $data->toArray(),
|
||||
|
||||
@@ -17,6 +17,7 @@ class WorldMap extends Component
|
||||
'mapData' => BookCase::query()
|
||||
->select(['id', 'latitude', 'longitude'])
|
||||
->withCount('orangePills')
|
||||
->active()
|
||||
->get()
|
||||
->map(fn($bookCase) => [
|
||||
'lat' => $bookCase->latitude,
|
||||
|
||||
@@ -123,6 +123,7 @@ class BookCaseTable extends DataTableComponent
|
||||
public function builder(): Builder
|
||||
{
|
||||
return BookCase::query()
|
||||
->active()
|
||||
->with([
|
||||
'orangePills',
|
||||
])
|
||||
|
||||
@@ -113,7 +113,7 @@ class CityTable extends DataTableComponent
|
||||
{
|
||||
$city = City::query()
|
||||
->find($id);
|
||||
$query = BookCase::radius($city->latitude, $city->longitude, 25);
|
||||
$query = BookCase::active()->radius($city->latitude, $city->longitude, 25);
|
||||
$ids = $query->pluck('id');
|
||||
if ($ids->isEmpty()) {
|
||||
$this->notification()
|
||||
|
||||
Reference in New Issue
Block a user