Ignore:
Timestamp:
2013/05/02 18:11:36 (11 years ago)
Author:
h_yoshimoto
Message:

#2236 2.12.3リリース以降の2.12-devへのコミット差し戻し

File:
1 edited

Legend:

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

    r22602 r22796  
    3232 * @version $Id$ 
    3333 */ 
    34 class LC_Page_FrontParts_Bloc_Category extends LC_Page_FrontParts_Bloc_Ex  
    35 { 
     34class LC_Page_FrontParts_Bloc_Category extends LC_Page_FrontParts_Bloc_Ex { 
    3635 
    3736    // }}} 
    3837    // {{{ functions 
    39     public $arrParentID; 
    4038 
    4139    /** 
     
    4442     * @return void 
    4543     */ 
    46     function init() 
    47     { 
     44    function init() { 
    4845        parent::init(); 
    4946    } 
     
    5451     * @return void 
    5552     */ 
    56     function process() 
    57     { 
     53    function process() { 
    5854        $this->action(); 
    5955        $this->sendResponse(); 
     
    6561     * @return void 
    6662     */ 
    67     function action() 
    68     { 
     63    function action() { 
    6964 
    7065        // モバイル判定 
     
    9085     * @return void 
    9186     */ 
    92     function destroy() 
    93     { 
     87    function destroy() { 
    9488        parent::destroy(); 
    9589    } 
     
    10195     * @return array $arrCategoryId 選択中のカテゴリID 
    10296     */ 
    103     function lfGetSelectedCategoryId($arrRequest) 
    104     { 
     97    function lfGetSelectedCategoryId($arrRequest) { 
    10598            // 商品ID取得 
    10699        $product_id = ''; 
     
    129122     * @return array $arrRet カテゴリツリーの配列を返す 
    130123     */ 
    131     function lfGetCatTree($arrParentCategoryId, $count_check = false) 
    132     { 
    133         $objCategory = new SC_Helper_Category_Ex($count_check); 
    134         $arrTree = $objCategory->getTree(); 
    135  
    136         $this->arrParentID = array(); 
     124    function lfGetCatTree($arrParentCategoryId, $count_check = false) { 
     125        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     126        $objDb = new SC_Helper_DB_Ex(); 
     127        $col = '*'; 
     128        $from = 'dtb_category left join dtb_category_total_count ON dtb_category.category_id = dtb_category_total_count.category_id'; 
     129        // 登録商品数のチェック 
     130        if ($count_check) { 
     131            $where = 'del_flg = 0 AND product_count > 0'; 
     132        } else { 
     133            $where = 'del_flg = 0'; 
     134        } 
     135        $objQuery->setOption('ORDER BY rank DESC'); 
     136        $arrRet = $objQuery->select($col, $from, $where); 
    137137        foreach ($arrParentCategoryId as $category_id) { 
    138             $arrParentID = $objCategory->getTreeTrail($category_id); 
    139             $this->arrParentID = array_merge($this->arrParentID, $arrParentID);  
     138            $arrParentID = $objDb->sfGetParents( 
     139                'dtb_category', 
     140                'parent_category_id', 
     141                'category_id', 
     142                $category_id 
     143            ); 
     144            $arrBrothersID = SC_Utils_Ex::sfGetBrothersArray( 
     145                $arrRet, 
     146                'parent_category_id', 
     147                'category_id', 
     148                $arrParentID 
     149            ); 
     150            $arrChildrenID = SC_Utils_Ex::sfGetUnderChildrenArray( 
     151                $arrRet, 
     152                'parent_category_id', 
     153                'category_id', 
     154                $category_id 
     155            ); 
    140156            $this->root_parent_id[] = $arrParentID[0]; 
    141         } 
    142  
    143         return $arrTree; 
     157            $arrDispID = array_merge($arrBrothersID, $arrChildrenID); 
     158            foreach ($arrRet as &$arrCategory) { 
     159                if (in_array($arrCategory['category_id'], $arrDispID)) { 
     160                    $arrCategory['display'] = 1; 
     161                } 
     162            } 
     163        } 
     164        return $arrRet; 
    144165    } 
    145166 
     
    150171     * @return array $arrMainCat メインカテゴリの配列を返す 
    151172     */ 
    152     function lfGetMainCat($count_check = false) 
    153     { 
     173    function lfGetMainCat($count_check = false) { 
    154174        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    155175        $col = '*'; 
Note: See TracChangeset for help on using the changeset viewer.