Changeset 22796 for branches/version-2_12-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Category.php
- Timestamp:
- 2013/05/02 18:11:36 (11 years ago)
- 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 32 32 * @version $Id$ 33 33 */ 34 class LC_Page_FrontParts_Bloc_Category extends LC_Page_FrontParts_Bloc_Ex 35 { 34 class LC_Page_FrontParts_Bloc_Category extends LC_Page_FrontParts_Bloc_Ex { 36 35 37 36 // }}} 38 37 // {{{ functions 39 public $arrParentID;40 38 41 39 /** … … 44 42 * @return void 45 43 */ 46 function init() 47 { 44 function init() { 48 45 parent::init(); 49 46 } … … 54 51 * @return void 55 52 */ 56 function process() 57 { 53 function process() { 58 54 $this->action(); 59 55 $this->sendResponse(); … … 65 61 * @return void 66 62 */ 67 function action() 68 { 63 function action() { 69 64 70 65 // モバイル判定 … … 90 85 * @return void 91 86 */ 92 function destroy() 93 { 87 function destroy() { 94 88 parent::destroy(); 95 89 } … … 101 95 * @return array $arrCategoryId 選択中のカテゴリID 102 96 */ 103 function lfGetSelectedCategoryId($arrRequest) 104 { 97 function lfGetSelectedCategoryId($arrRequest) { 105 98 // 商品ID取得 106 99 $product_id = ''; … … 129 122 * @return array $arrRet カテゴリツリーの配列を返す 130 123 */ 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); 137 137 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 ); 140 156 $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; 144 165 } 145 166 … … 150 171 * @return array $arrMainCat メインカテゴリの配列を返す 151 172 */ 152 function lfGetMainCat($count_check = false) 153 { 173 function lfGetMainCat($count_check = false) { 154 174 $objQuery =& SC_Query_Ex::getSingletonInstance(); 155 175 $col = '*';
Note: See TracChangeset
for help on using the changeset viewer.