search refactor3
This commit is contained in:
parent
3b7532429c
commit
022f6027cc
|
|
@ -527,10 +527,8 @@ class ProductRepository extends PRepository
|
|||
|
||||
|
||||
$qb = app(ProductFlatRepository::class)->getModel()::search(implode(' OR ', $queries))
|
||||
->take($perPage)
|
||||
// ->query(fn ($query) =>)
|
||||
// ->where('status', 1)
|
||||
// ->where('visible_individually', 1)
|
||||
->where('status', 1)
|
||||
->where('visible_individually', 1)
|
||||
->where('channel', $channel)
|
||||
->where('locale', $locale)
|
||||
->orderBy('product_id', 'desc');
|
||||
|
|
|
|||
|
|
@ -50,6 +50,19 @@ class ProductFlat extends Model implements ProductFlatContract
|
|||
return 'products_index';
|
||||
}
|
||||
|
||||
public function toSearchableArray():array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'locale' => $this->locale,
|
||||
'channel' => $this->channel,
|
||||
'name' => $this->name,
|
||||
'meta_keywords' => $this->meta_keywords,
|
||||
'status' => $this->status,
|
||||
'visible_individually'=> $this->visible_individually,
|
||||
'product_id' => $this->product_id
|
||||
];
|
||||
}
|
||||
/**
|
||||
* Get an attribute from the model.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue