@@ -46,12 +46,12 @@ |
||
46 | 46 | public static function getProducts($id = null){ |
47 | 47 | if($id === null){ |
48 | 48 | $products = Product::all(); |
49 | - }else{ |
|
49 | + } else{ |
|
50 | 50 | if(Category::find($id)){ |
51 | 51 | $belong_to_this_category = Category::find($id)->children->pluck('id')->toArray(); |
52 | 52 | $result = array_merge($belong_to_this_category, [0 =>$id]); |
53 | 53 | $products = Product::whereIn('category_id',$result)->get(); |
54 | - }else{ |
|
54 | + } else{ |
|
55 | 55 | $products = []; |
56 | 56 | } |
57 | 57 | } |