mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
fixed indexing of Producers model
This commit is contained in:
parent
7ba31ce91f
commit
28a2dbdcaa
@ -59,11 +59,13 @@ class Producers extends JikanApiSearchableModel
|
||||
|
||||
public function toSearchableArray(): array
|
||||
{
|
||||
$titles = !is_null($this->titles) ? collect($this->titles)->map(fn ($x) => $x["title"])->toArray() : [''];
|
||||
|
||||
return [
|
||||
'id' => (string) $this->mal_id,
|
||||
'mal_id' => (int) $this->mal_id,
|
||||
'url' => !is_null($this->url) ? $this->url : '',
|
||||
'titles' => !is_null($this->titles) ? collect($this->titles)->map(fn ($x) => $x["title"])->toArray() : [''],
|
||||
'titles' => implode(', ', $titles),
|
||||
'established' => $this->convertToTimestamp($this->established),
|
||||
'favorites' => $this->favorites,
|
||||
'count' => $this->count
|
||||
@ -80,6 +82,6 @@ class Producers extends JikanApiSearchableModel
|
||||
|
||||
public function getTitleAttributeName(): string
|
||||
{
|
||||
return 'titles';
|
||||
return 'titles_idx';
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user