sources api

This commit is contained in:
merdan 2022-09-29 18:09:44 +05:00
parent 0516a4e4d3
commit 868602b580
3 changed files with 7 additions and 4 deletions

View File

@ -73,10 +73,11 @@ class SearchController extends V1Controller
$products = $this->productFlatRepository->getModel()::search(implode(' OR ', $key))
// ->where('channel', $channel)
// ->where('locale', $locale)
->where('status', 1)
->where('visible_individually', 1)
->take(50)
->query(fn ($query) => $query->select('id','name','product_id','description')
->where('status', 1)
->where('visible_individually', 1)
// ->addSelect(DB::raw("\'product\' as type" ))
->orderBy('name'))
// ->take(10)

View File

@ -61,6 +61,8 @@ class ProductFlat extends Model implements ProductFlatContract
'name' => $this->name,
// 'meta_title' => $this->meta_title,
'meta_keywords' => $this->meta_keywords,
'status' => $this->status,
'visible_individually' => $this->visible_individually
];
}
/**

View File

@ -461,8 +461,8 @@ class ProductRepository extends Repository
$results = app(ProductFlatRepository::class)->getModel()::search(implode(' OR ', $queries))
->where('status', 1)
->where('visible_individually', 1)
->where('channel', $channel)
->where('locale', $locale)
// ->where('channel', $channel)
// ->where('locale', $locale)
->orderBy('product_id', 'desc')
->paginate(16);
} else {