Ignore:
Timestamp:
2013/03/01 22:21:08 (11 years ago)
Author:
pineray
Message:

#2166 カテゴリー情報の取得処理をヘルパークラスへ移動

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/helper/SC_Helper_Category.php

    r22594 r22595  
    4141    { 
    4242        $this->count_check = $count_check; 
     43    } 
     44 
     45    /** 
     46     * カテゴリーの情報を取得. 
     47     *  
     48     * @param integer $category_id カテゴリーID 
     49     * @return array 
     50     */ 
     51    public function get($category_id) 
     52    { 
     53        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     54        $col = '*'; 
     55        $from = 'dtb_category left join dtb_category_total_count ON dtb_category.category_id = dtb_category_total_count.category_id'; 
     56        $where = 'dtb_category.category_id = ? AND del_flg = 0'; 
     57        // 登録商品数のチェック 
     58        if ($this->count_check) { 
     59            $where .= ' AND product_count > 0'; 
     60        } 
     61        $arrRet = $objQuery->getRow($col, $from, $where, array($category_id)); 
     62        return $arrRet; 
    4363    } 
    4464 
     
    88108        return $arrTree; 
    89109    } 
     110 
     111    /** 
     112     * 親カテゴリーIDの配列を取得. 
     113     *  
     114     * @param integer $category_id 起点のカテゴリーID 
     115     * @return array 
     116     */ 
     117    public function getTreeTrail($category_id) 
     118    { 
     119        $arrCategory = $this->getList(); 
     120        $arrTrailID = SC_Utils_Ex::getTreeTrail($category_id, 'category_id', 'parent_category_id', $arrCategory); 
     121        return $arrTrailID; 
     122    } 
    90123} 
Note: See TracChangeset for help on using the changeset viewer.