本文整理匯總了PHP中app\models\Product::GetProductsByMainAndSubCategory方法的典型用法代碼示例。如果您正苦於以下問題:PHP Product::GetProductsByMainAndSubCategory方法的具體用法?PHP Product::GetProductsByMainAndSubCategory怎麽用?PHP Product::GetProductsByMainAndSubCategory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\models\Product
的用法示例。
在下文中一共展示了Product::GetProductsByMainAndSubCategory方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: GetMainAndSubCategory
public function GetMainAndSubCategory($category, $sub_category)
{
$category_subCategory = Category::GetCategoryAndSubcategoryInfo($category, $sub_category);
if (count($category_subCategory) == 0) {
return Redirect::to("/");
}
$translatedCategory = Category::TranslateCategoryName($category);
$translatedSubcategory = Category::TranslateSubcategoryName($sub_category);
$sub_categories = Category::GetSubCategories($category_subCategory[0]->category_id);
$newest_products = Product::GetProductsByMainAndSubCategory($translatedCategory[0]->category_id, $translatedSubcategory[0]->sub_category_id);
$data["newest_products"] = $newest_products;
$data["sub_info"] = $category_subCategory;
$data["sub_categories"] = $sub_categories;
return view("sub_category", ["data" => $data]);
}
示例2: GetVideoProducts
public function GetVideoProducts($cat, $sub)
{
$products = Product::GetProductsByMainAndSubCategory($cat, $sub);
$data["products"] = $products;
return view("AdminPanel.productsAsArticlesForVideo", ["data" => $data]);
}