search refactor3

This commit is contained in:
merdan 2023-08-15 14:53:23 +05:00
parent c1cec78497
commit 724ef42e97
1 changed files with 16 additions and 0 deletions

View File

@ -49,10 +49,26 @@ class ProductFlat extends Model implements ProductFlatContract
{ {
return 'products_index'; return 'products_index';
} }
public function searchable(): bool public function searchable(): bool
{ {
return $this->status || $this->visible_individually; return $this->status || $this->visible_individually;
} }
public function toSearchableArray():array
{
return [
'id' => $this->id,
'name' => $this->name,
'locale' => $this->locale,
'channel' => $this->channel,
'min_price' => $this->min_price,
'meta_keywords' => $this->meta_keywords,
'status' => $this->status,
'visible_individually'=> $this->visible_individually,
'product_id' => $this->product_id
];
}
/** /**
* Get an attribute from the model. * Get an attribute from the model.
* *