Changeset 17333
- Timestamp:
- 2008/05/29 12:45:32 (16 years ago)
- Location:
- branches/version-2/data
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2/data/Smarty/templates/default/detail.tpl
r16971 r17333 130 130 <!--{/if}--> 131 131 <!--{/if}-->Pt</span></div> 132 133 <!--{* 関連カテゴリ *}--> 134 <div>関連カテゴリ: 135 <!--{section name=r loop=$arrRelativeCat}--> 136 <p> 137 <!--{section name=s loop=$arrRelativeCat[r]}--> 138 <a href="<!--{$smarty.const.URL_DIR}-->products/list.php?category_id=<!--{$arrRelativeCat[r][s].category_id}-->"><!--{$arrRelativeCat[r][s].category_name}--></a> 139 <!--{if !$smarty.section.s.last}--><!--{$smarty.const.SEPA_CATNAVI}--><!--{/if}--> 140 <!--{/section}--> 141 </p> 142 <!--{/section}--> 143 </div> 132 144 133 145 -
branches/version-2/data/class/helper/SC_Helper_DB.php
r16970 r17333 564 564 565 565 /** 566 * カテゴリツリーの取得を複数カテゴリーで行う. 567 * 568 * @param integer $product_id 商品ID 569 * @param bool $count_check 登録商品数のチェックを行う場合 true 570 * @return array カテゴリツリーの配列 571 */ 572 function sfGetMultiCatTree($product_id, $count_check = false) { 573 $objQuery = new SC_Query(); 574 $col = ""; 575 $col .= " cat.category_id,"; 576 $col .= " cat.category_name,"; 577 $col .= " cat.parent_category_id,"; 578 $col .= " cat.level,"; 579 $col .= " cat.rank,"; 580 $col .= " cat.creator_id,"; 581 $col .= " cat.create_date,"; 582 $col .= " cat.update_date,"; 583 $col .= " cat.del_flg, "; 584 $col .= " ttl.product_count"; 585 $from = "dtb_category as cat left join dtb_category_total_count as ttl on ttl.category_id = cat.category_id"; 586 // 登録商品数のチェック 587 if($count_check) { 588 $where = "del_flg = 0 AND product_count > 0"; 589 } else { 590 $where = "del_flg = 0"; 591 } 592 $objQuery->setoption("ORDER BY rank DESC"); 593 $arrRet = $objQuery->select($col, $from, $where); 594 595 $arrCategory_id = $this->sfGetCategoryId($product_id, $status); 596 597 $arrCatTree = array(); 598 foreach ($arrCategory_id as $pkey => $parent_category_id) { 599 $arrParentID = $this->sfGetParents($objQuery, 'dtb_category', 'parent_category_id', 'category_id', $parent_category_id); 600 601 foreach($arrParentID as $pid) { 602 foreach($arrRet as $key => $array) { 603 if($array['category_id'] == $pid) { 604 $arrCatTree[$pkey][] = $arrRet[$key]; 605 break; 606 } 607 } 608 } 609 } 610 611 return $arrCatTree; 612 } 613 614 /** 566 615 * 親カテゴリーを連結した文字列を取得する. 567 616 * -
branches/version-2/data/class/pages/products/LC_Page_Products_Detail.php
r16780 r17333 210 210 $this->tpl_subtitle = $arrFirstCat['name']; 211 211 212 // 関連カテゴリを取得 213 $this->arrRelativeCat = $objDb->sfGetMultiCatTree($tmp_id); 214 212 215 // DBからのデータを引き継ぐ 213 216 $this->objUpFile->setDBFileList($this->arrProduct);
Note: See TracChangeset
for help on using the changeset viewer.