Changeset 23437
- Timestamp:
- 2014/05/21 13:02:52 (7 years ago)
- Location:
- branches/version-2_13-dev/data/class
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_13-dev/data/class/helper/SC_Helper_Category.php
r23436 r23437 67 67 * カテゴリー一覧の取得. 68 68 * 69 * @param boolean $cid_to_key 配列のキーをカテゴリーIDにする場合はtrue 69 * @param bool $cid_to_key 配列のキーをカテゴリーIDにする場合はtrue 70 * @param bool $reset スタティック変数をリセットする場合はtrue 70 71 * @return array カテゴリー一覧の配列 71 72 */ 72 public function getList($cid_to_key = FALSE )73 public function getList($cid_to_key = FALSE, $reset = FALSE) 73 74 { 74 75 static $arrCategory = array(), $cidIsKey = array(); 76 77 if ($reset) { 78 $arrCategory = array(); 79 $cidIsKey = array(); 80 } 75 81 76 82 if (!isset($arrCategory[$this->count_check])) { … … 105 111 * カテゴリーツリーの取得. 106 112 * 113 * @param bool $reset スタティック変数をリセットする場合はtrue 107 114 * @return array 108 115 */ 109 public function getTree( )116 public function getTree($reset = false) 110 117 { 111 118 static $arrTree = array(); 119 120 if ($reset) { 121 $arrTree = array(); 122 } 123 112 124 if (!isset($arrTree[$this->count_check])) { 113 $arrList = $this->getList( );125 $arrList = $this->getList(false, $reset); 114 126 $arrTree[$this->count_check] = SC_Utils_Ex::buildTree('category_id', 'parent_category_id', LEVEL_MAX, $arrList); 115 127 } -
branches/version-2_13-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Category.php
r23436 r23437 172 172 // 親カテゴリIDの保持 173 173 $this->arrForm['parent_category_id'] = $parent_category_id; 174 // カテゴリツリーを取得 175 $this->arrTree = $objCategory->getTree(true); 176 $this->arrParentID = $objCategory->getTreeTrail($parent_category_id); 174 177 // カテゴリ一覧を取得 175 $this->arrList = $this->findCategoiesByParentCategoryId($parent_category_id); 176 // カテゴリツリーを取得 177 $this->arrTree = $objCategory->getTree(); 178 $this->arrParentID = $objCategory->getTreeTrail($parent_category_id); 178 $this->arrList = $objCategory->getTreeBranch($parent_category_id); 179 179 // ぱんくずの生成 180 180 $arrBread = $objCategory->getTreeTrail($this->arrForm['parent_category_id'], FALSE); … … 374 374 $objFormParam->addParam('カテゴリID', 'category_id', null, null, array()); 375 375 $objFormParam->addParam('カテゴリ名', 'category_name', STEXT_LEN, 'KVa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK')); 376 }377 378 /**379 * 親カテゴリIDでカテゴリを検索する.380 *381 * - 表示順の降順でソートする382 * - 有効なカテゴリを返す(del_flag = 0)383 *384 * @param SC_Query $objQuery385 * @param int $parent_category_id 親カテゴリID386 * @return array カテゴリの配列387 */388 public function findCategoiesByParentCategoryId($parent_category_id)389 {390 if (!$parent_category_id) {391 $parent_category_id = 0;392 }393 $objQuery =& SC_Query_Ex::getSingletonInstance();394 $col = 'category_id, category_name, level, rank';395 $where = 'del_flg = 0 AND parent_category_id = ?';396 $objQuery->setOption('ORDER BY rank DESC');397 398 return $objQuery->select($col, 'dtb_category', $where, array($parent_category_id));399 376 } 400 377
Note: See TracChangeset
for help on using the changeset viewer.