Skip to content

Commit f3353a2

Browse files
committed
feat: filter search results to include only active products and shops.
1 parent ec0df84 commit f3353a2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/Http/Controllers/User/SearchController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ public function search($query,$userId){
1919
->orWhere("product_description","like","%{$query}%")
2020
->orWhere("product_price","like","%{$query}%")
2121
->orWhere("product_price","like","%{$query}%")
22+
->where('status',1)
2223
->take(5)->get();
2324

2425
$shops=Shop::where("shop_name",'like',"%{$query}%")
2526
->orWhere("shop_description","like","%{$query}%")
2627
->orWhere("shop_description","like","%{$query}%")
28+
->where('status',1)
2729
->take(5)->get();
2830

2931
if($userId!=0){

0 commit comments

Comments
 (0)