当前位置: 首页>>代码示例>>PHP>>正文


PHP ProductCategory::whereRaw方法代码示例

本文整理汇总了PHP中ProductCategory::whereRaw方法的典型用法代码示例。如果您正苦于以下问题:PHP ProductCategory::whereRaw方法的具体用法?PHP ProductCategory::whereRaw怎么用?PHP ProductCategory::whereRaw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProductCategory的用法示例。


在下文中一共展示了ProductCategory::whereRaw方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _get_children

 private function _get_children($category_id)
 {
     $children = array();
     $cat_details = ProductCategory::whereRaw('parent_category_id = ?', array($category_id))->orderBy('category_left', 'ASC')->get(array('id', 'category_name', 'category_left', 'category_right', 'parent_category_id', 'category_level', 'display_order'));
     if (count($cat_details) > 0) {
         foreach ($cat_details as $cat) {
             $children[$cat->id] = $cat;
         }
     }
     return $children;
 }
开发者ID:agriya,项目名称:webshoppack,代码行数:11,代码来源:AdminManageProductCatalogService.php

示例2: populateProductCategoryList

 public function populateProductCategoryList($cat_id = '')
 {
     $catList = array();
     $cat_id = $cat_id == '' || $cat_id == 0 ? $this->root_category_id : $cat_id;
     $cat_details = ProductCategory::whereRaw('parent_category_id = ?', array($cat_id))->orderBy('category_left', 'ASC')->get(array('id', 'category_name', 'seo_category_name'));
     if (count($cat_details) > 0) {
         foreach ($cat_details as $catkey => $cat) {
             $catList[$catkey] = $cat;
             $count = isset($this->prod_cat_count_arr[$cat['id']]) ? $this->prod_cat_count_arr[$cat['id']] : 0;
             $catList[$catkey]['cat_id'] = $cat['id'];
             $catList[$catkey]['product_count'] = $count;
             $catList[$catkey]['cat_link'] = $this->urlLink($cat['seo_category_name']);
         }
     }
     return $catList;
 }
开发者ID:agriya,项目名称:webshoppack,代码行数:16,代码来源:ProductService.php

示例3: deleteCategoryImage

 public function deleteCategoryImage($id, $filename, $ext, $folder_name)
 {
     $data_arr = array('image_name' => '', 'image_ext' => '', 'image_height' => '', 'image_width' => '');
     $affectedRows = ProductCategory::whereRaw('id = ?', array($id))->update($data_arr);
     if ($affectedRows) {
         $this->deleteImageFiles($filename, $ext, $folder_name);
         return true;
     }
     return false;
 }
开发者ID:agriya,项目名称:webshoppack,代码行数:10,代码来源:AdmipProductCategoryService.php

示例4: isCategoryExists

 public function isCategoryExists($category_id)
 {
     $category_count = ProductCategory::whereRaw('id = ?', array($category_id))->count();
     return $category_count;
 }
开发者ID:agriya,项目名称:webshoppack,代码行数:5,代码来源:AdminCategoryAttributesService.php


注:本文中的ProductCategory::whereRaw方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。