Meilisearch make links not absolute
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Arwed Molitor 2024-03-17 18:27:42 +01:00 committed by philipp lang
parent 5d256293fb
commit 0f0745749d
1 changed files with 8 additions and 8 deletions

View File

@ -182,7 +182,7 @@ class Member extends Model implements Geolocatable
protected function getAusstand(): int protected function getAusstand(): int
{ {
return (int) $this->invoicePositions()->whereHas('invoice', fn ($query) => $query->whereNeedsPayment())->sum('price'); return (int) $this->invoicePositions()->whereHas('invoice', fn($query) => $query->whereNeedsPayment())->sum('price');
} }
// ---------------------------------- Relations ---------------------------------- // ---------------------------------- Relations ----------------------------------
@ -317,7 +317,7 @@ class Member extends Model implements Geolocatable
return $query->addSelect([ return $query->addSelect([
'pending_payment' => InvoicePosition::selectRaw('SUM(price)') 'pending_payment' => InvoicePosition::selectRaw('SUM(price)')
->whereColumn('invoice_positions.member_id', 'members.id') ->whereColumn('invoice_positions.member_id', 'members.id')
->whereHas('invoice', fn ($query) => $query->whereNeedsPayment()), ->whereHas('invoice', fn($query) => $query->whereNeedsPayment()),
]); ]);
} }
@ -328,7 +328,7 @@ class Member extends Model implements Geolocatable
*/ */
public function scopeWhereHasPendingPayment(Builder $query): Builder public function scopeWhereHasPendingPayment(Builder $query): Builder
{ {
return $query->whereHas('invoicePositions', fn ($q) => $q->whereHas('invoice', fn ($q) => $q->whereNeedsPayment())); return $query->whereHas('invoicePositions', fn($q) => $q->whereHas('invoice', fn($q) => $q->whereNeedsPayment()));
} }
/** /**
@ -443,7 +443,7 @@ class Member extends Model implements Geolocatable
'name' => $this->fullname, 'name' => $this->fullname,
'address' => $this->address, 'address' => $this->address,
'zipLocation' => $this->zip . ' ' . $this->location, 'zipLocation' => $this->zip . ' ' . $this->location,
'mglnr' => Lazy::create(fn () => 'Mglnr.: ' . $this->nami_id), 'mglnr' => Lazy::create(fn() => 'Mglnr.: ' . $this->nami_id),
]); ]);
} }
@ -452,7 +452,7 @@ class Member extends Model implements Geolocatable
*/ */
public static function forSelect(): array public static function forSelect(): array
{ {
return static::select(['id', 'firstname', 'lastname'])->get()->map(fn ($member) => ['id' => $member->id, 'name' => $member->fullname])->toArray(); return static::select(['id', 'firstname', 'lastname'])->get()->map(fn($member) => ['id' => $member->id, 'name' => $member->fullname])->toArray();
} }
// -------------------------------- Geolocation -------------------------------- // -------------------------------- Geolocation --------------------------------
@ -503,13 +503,13 @@ class Member extends Model implements Geolocatable
'group_id' => $this->group->id, 'group_id' => $this->group->id,
'group_name' => $this->group->inner_name ?: $this->group->name, 'group_name' => $this->group->inner_name ?: $this->group->name,
'links' => [ 'links' => [
'show' => route('member.show', ['member' => $this]), 'show' => route('member.show', ['member' => $this], false),
'edit' => route('member.edit', ['member' => $this]), 'edit' => route('member.edit', ['member' => $this], false),
], ],
'age_group_icon' => $this->ageGroupMemberships->first()?->subactivity->slug, 'age_group_icon' => $this->ageGroupMemberships->first()?->subactivity->slug,
'is_leader' => $this->leaderMemberships()->count() > 0, 'is_leader' => $this->leaderMemberships()->count() > 0,
'memberships' => $this->memberships()->active()->get() 'memberships' => $this->memberships()->active()->get()
->map(fn ($membership) => [...$membership->only('activity_id', 'subactivity_id'), 'both' => $membership->activity_id . '|' . $membership->subactivity_id, 'with_group' => $membership->group_id . '|' . $membership->activity_id . '|' . $membership->subactivity_id]), ->map(fn($membership) => [...$membership->only('activity_id', 'subactivity_id'), 'both' => $membership->activity_id . '|' . $membership->subactivity_id, 'with_group' => $membership->group_id . '|' . $membership->activity_id . '|' . $membership->subactivity_id]),
]; ];
} }
} }