Changeset 16147 for branches/feature-module-update/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Category.php
- Timestamp:
- 2007/09/28 13:08:06 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Category.php
r15532 r16147 14 14 * @package Page 15 15 * @author LOCKON CO.,LTD. 16 * @version $Id $16 * @version $Id:LC_Page_FrontParts_Bloc_Category.php 15532 2007-08-31 14:39:46Z nanasess $ 17 17 */ 18 18 class LC_Page_FrontParts_Bloc_Category extends LC_Page { … … 48 48 49 49 $objSubView->assignobj($objPage); 50 $objSubView->display($this->tpl_mainpage); 51 } 52 53 /** 54 * モバイルページを初期化する. 55 * 56 * @return void 57 */ 58 function mobileInit() { 59 $this->tpl_mainpage = MOBILE_TEMPLATE_DIR . "frontparts/" 60 . BLOC_DIR . 'category.tpl'; 61 } 62 63 /** 64 * Page のプロセス(モバイル). 65 * 66 * @return void 67 */ 68 function mobileProcess() { 69 $objSubView = new SC_MobileView(); 70 71 $this->lfGetMainCat(true, $this); 72 73 $objSubView->assignobj($this); 50 74 $objSubView->display($this->tpl_mainpage); 51 75 } … … 95 119 return $objSubPage; 96 120 } 121 122 // メインカテゴリーの取得 123 function lfGetMainCat($count_check = false, &$objSubPage) { 124 $objQuery = new SC_Query(); 125 $col = "*"; 126 $from = "dtb_category left join dtb_category_total_count using (category_id)"; 127 // メインカテゴリーとその直下のカテゴリーを取得する。 128 $where = 'level <= 2 AND del_flg = 0'; 129 // 登録商品数のチェック 130 if($count_check) { 131 $where .= " AND product_count > 0"; 132 } 133 $objQuery->setoption("ORDER BY rank DESC"); 134 $arrRet = $objQuery->select($col, $from, $where); 135 136 // メインカテゴリーを抽出する。 137 $arrMainCat = array(); 138 foreach ($arrRet as $cat) { 139 if ($cat['level'] != 1) { 140 continue; 141 } 142 143 // 子カテゴリーを持つかどうかを調べる。 144 $arrChildrenID = SC_Utils_Ex::sfGetUnderChildrenArray($arrRet, 'parent_category_id', 'category_id', $cat['category_id']); 145 $cat['has_children'] = count($arrChildrenID) > 0; 146 $arrMainCat[] = $cat; 147 } 148 149 $objSubPage->arrCat = $arrMainCat; 150 return $objSubPage; 151 } 97 152 } 98 153 ?>
Note: See TracChangeset
for help on using the changeset viewer.