本文整理汇总了PHP中app\models\Category::getChild方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::getChild方法的具体用法?PHP Category::getChild怎么用?PHP Category::getChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Category
的用法示例。
在下文中一共展示了Category::getChild方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filterIndex
public function filterIndex($category_id = false, $brand_id = false, $provider_id = false)
{
if ($category_id or $provider_id or $brand_id) {
if ($category_id === '0') {
$ids = false;
} else {
$categoryModel = new Category();
$ids = $categoryModel->getChild($category_id);
}
if ($provider_id === '0') {
$provider_id = false;
}
if ($brand_id === '0') {
$brand_id = false;
}
$arParams = array('categories' => $ids, 'brand' => $brand_id, 'provider' => $provider_id);
return $this->buildIndex('filter', $arParams);
}
}
示例2: getExistInCategoryProvedrsList
public function getExistInCategoryProvedrsList($category_id)
{
$categoryModel = new Category();
$category_ids = $categoryModel->getChild($category_id);
return $this->select('providers.id', 'providers.name')->leftJoin('purchase as pur', 'providers.id', '=', 'pur.vendor_id')->leftJoin('products as prod', 'pur.product_id', '=', 'prod.id')->leftJoin('product_categories as cat', 'prod.category_id', '=', 'cat.id')->whereIn('cat.id', $category_ids)->distinct()->get();
}
示例3: categoryIndex
public function categoryIndex(Category $categoryModel, $id)
{
$ids = $categoryModel->getChild($id);
$chain = $categoryModel->getParents($id);
return $this->buildIndex('category', $ids, $chain);
}
示例4: flag
public function flag($category_id, Category $categoryModel, Product $productModel)
{
$childs = $categoryModel->getChild($category_id);
$products = $productModel->getIdByCategoryId($childs);
$productModel->setFlagsByProductsId($products);
Session::flash('message', GetMessages("SUCCESS_ADD_FLAG"));
return redirect($_SERVER['HTTP_REFERER']);
}