Open sidebar
public static function getAllById($id){ $product = DB::table('products_e2 as e2') ->select('e2.*') ->where('e2.id_product', '=', $id) ->get(); $images = DB::table('images_e6 as e6') ->select('e6.id_img', 'e6.link', 'e6.main') ->where('e6.id_product', '=', $id) ->get(); $categories = DB::table('categories_e14 as e14') ->join('product_categories_e15 as e15', 'e15.id_category', '=', 'e14.id_category') ->join('products_e2 as e2', 'e2.id_product', '=', 'e15.id_product') ->select('e14.id_category', 'e14.id_parent_category', 'e14.title') ->where('e2.id_product', '=', $id) ->get(); $ingredients = DB::table('ingredients_e4 as e4') ->join('product_ingredients_e9 as e9', 'e9.id_ingredient', '=', 'e4.id_ingredient') ->join('products_e2 as e2', 'e2.id_product', '=', 'e9.id_product') ->select('e4.id_ingredient', 'e4.title') ->where('e2.id_product', '=', $id) ->get(); $tags = DB::table('tags_e5 as e5') ->join('product_tags_e10 as e10', 'e10.id_tag', '=', 'e5.id_tag') ->join('products_e2 as e2', 'e2.id_product', '=', 'e10.id_product') ->select('e5.id_tag', 'e5.title') ->where('e2.id_product', '=', $id) ->get(); $options = DB::table('product_options_e8 as e8') ->join('sizes_e3 as e3', 'e3.id_size', '=', 'e8.id_size') ->select('e8.*', 'e3.title', 'e3.type') ->where('e8.id_product', '=', $id) ->get(); $allAboutProduct = array(); array_push($allAboutProduct, $product, $images, $categories, $ingredients, $tags, $options); return $allAboutProduct; }
Close sidebar
Back
Please note that all pasted data is publicly available.
X (fomerly Twitter)
GitHub
Use setting
Back
Please note that all pasted data is publicly available.
X (fomerly Twitter)
GitHub
Use setting