Changeset 22588


Ignore:
Timestamp:
2013/03/01 05:15:36 (6 years ago)
Author:
pineray
Message:

#2166 カテゴリーツリーの生成処理を別ファイルへ分離

Location:
branches/version-2_12-dev/data
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Category.php

    r22586 r22588  
    130130    function lfGetCatTree($arrParentCategoryId, $count_check = false) 
    131131    { 
    132         $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    133132        $objDb = new SC_Helper_DB_Ex(); 
    134  
    135         $col = '*'; 
    136         $from = 'dtb_category left join dtb_category_total_count ON dtb_category.category_id = dtb_category_total_count.category_id'; 
    137         // 登録商品数のチェック 
    138         if ($count_check) { 
    139             $where = 'del_flg = 0 AND product_count > 0'; 
    140         } else { 
    141             $where = 'del_flg = 0'; 
    142         } 
    143         $objQuery->setOption('ORDER BY rank DESC'); 
    144         $arrRet = $objQuery->select($col, $from, $where); 
    145  
    146         $arrTree = SC_Utils_Ex::buildTree('category_id', 'parent_category_id', 10, $arrRet); 
    147  
     133        $objCategory = new SC_Helper_Category_Ex(); 
     134        $arrTree = $objCategory->getTree($count_check); 
     135 
     136        $arrCategory = $objCategory->getList($count_check); 
    148137        foreach ($arrParentCategoryId as $category_id) { 
    149138            $arrParentID = $objDb->sfGetParents( 
     
    154143            ); 
    155144            $arrBrothersID = SC_Utils_Ex::sfGetBrothersArray( 
    156                 $arrRet, 
     145                $arrCategory, 
    157146                'parent_category_id', 
    158147                'category_id', 
     
    160149            ); 
    161150            $arrChildrenID = SC_Utils_Ex::sfGetUnderChildrenArray( 
    162                 $arrRet, 
     151                $arrCategory, 
    163152                'parent_category_id', 
    164153                'category_id', 
Note: See TracChangeset for help on using the changeset viewer.