Changeset 18862


Ignore:
Timestamp:
2010/10/21 13:24:43 (10 years ago)
Author:
nanasess
bzr:base-revision:
svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:18861
bzr:committer:
Kentaro Ohkouchi <ohkouchi@loop-az.jp>
bzr:file-ids:

data/Smarty/templates/default/detail.tpl 15747@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2FSmarty%2Ftemplates%2Fdefault%2Fdetail.tpl
data/Smarty/templates/default/list.tpl 15747@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2FSmarty%2Ftemplates%2Fdefault%2Flist.tpl
data/class/SC_Product.php 18277@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcomu-ver2%2Fdata%2Fclass%2FSC_Product.php
data/class/pages/products/LC_Page_Products_Detail.php 15154@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fproducts%2FLC_Page_Products_Detail.php
data/class/pages/products/LC_Page_Products_List.php 15154@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fproducts%2FLC_Page_Products_List.php
html/install/sql/insert_data.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Finsert_data.sql
bzr:mapping-version:
v4
bzr:repository-uuid:
1e3b908f-19a9-db11-a64c-001125224ba8
bzr:revision-id:
ohkouchi@loop-az.jp-20101021042440-gpxusyehl2k95qsv
bzr:revno:
2342
bzr:revprop:branch-nick:
branches/version-2_5-dev
bzr:root:
branches/version-2_5-dev
bzr:timestamp:
2010-10-21 13:24:40.163000107 +0900
bzr:user-agent:
bzr2.2.0+bzr-svn1.0.3
svn:original-date:
2010-10-21T04:24:40.163000Z
Message:

#781 規格のデータベースを木構造に

  • 商品ステータスの表示に対応
Location:
branches/version-2_5-dev
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/Smarty/templates/default/detail.tpl

    r18833 r18862  
    194194        <div id="detailrightblock"> 
    195195            <!--▼商品ステータス--> 
    196             <!--{if count($arrProduct.product_flag) > 0}--> 
     196            <!--{assign var=ps value=$productStatus[$smarty.get.product_id]}--> 
     197            <!--{if count($ps) > 0}--> 
    197198                <ul class="status_icon"> 
    198                     <!--{section name=flg loop=$arrProduct.product_flag|count_characters}--> 
    199                     <!--{if $arrProduct.product_flag[flg] == "1"}--> 
     199                    <!--{foreach from=$ps item=status}--> 
    200200                    <li> 
    201                         <!--{assign var=key value="`$smarty.section.flg.iteration`"}--> 
    202                         <img src="<!--{$TPL_DIR}--><!--{$arrSTATUS_IMAGE[$key]}-->" width="65" height="17" alt="<!--{$arrSTATUS[$key]}-->" id="icon<!--{$key}-->" /> 
     201                        <img src="<!--{$TPL_DIR}--><!--{$arrSTATUS_IMAGE[$status]}-->" width="65" height="17" alt="<!--{$arrSTATUS[$status]}-->" id="icon<!--{$status}-->" /> 
    203202                    </li> 
    204                     <!--{/if}--> 
    205                     <!--{/section}--> 
     203                    <!--{/foreach}--> 
    206204                </ul> 
    207205            <!--{/if}--> 
  • branches/version-2_5-dev/data/Smarty/templates/default/list.tpl

    r18852 r18862  
    233233            <div class="listrightblock"> 
    234234                <!--▼商品ステータス--> 
    235                 <!--{if $arrProduct.product_flag|strpos:"1" !== false}--> 
     235                <!--{if count($productStatus[$id]) > 0}--> 
    236236                    <ul class="status_icon"> 
    237                         <!--{section name=flg loop=$arrProduct.product_flag|count_characters}--> 
    238                             <!--{if $arrProduct.product_flag[flg] == "1"}--> 
    239                                 <li> 
    240                                     <!--{assign var=key value="`$smarty.section.flg.iteration`"}--> 
    241                                     <img src="<!--{$TPL_DIR}--><!--{$arrSTATUS_IMAGE[$key]}-->" width="65" height="17" alt="<!--{$arrSTATUS[$key]}-->"/> 
    242                                 </li> 
    243                             <!--{/if}--> 
    244                         <!--{/section}--> 
     237                        <!--{foreach from=$productStatus[$id] item=status}-->  
     238                            <li> 
     239                                <img src="<!--{$TPL_DIR}--><!--{$arrSTATUS_IMAGE[$status]}-->" width="65" height="17" alt="<!--{$arrSTATUS[$status]}-->"/> 
     240                            </li> 
     241                        <!--{/foreach}--> 
    245242                    </ul> 
    246243                <!--{/if}--> 
  • branches/version-2_5-dev/data/class/SC_Product.php

    r18860 r18862  
    421421        } 
    422422        return $productsClass; 
     423    } 
     424 
     425    /** 
     426     * 商品IDをキーにした, 商品ステータスIDの配列を取得する. 
     427     * 
     428     * @param array 商品ID の配列 
     429     * @return array 商品IDをキーにした商品ステータスIDの配列 
     430     */ 
     431    function getProductStatus($productIds) { 
     432        $objQuery =& SC_Query::getSingletonInstance(); 
     433        $productStatus = $objQuery->select("product_id, product_status_id", 
     434                                           "dtb_product_status", 
     435                                           'del_flg = 0 AND product_id IN (' . implode(', ', array_pad(array(), count($productIds), '?')) . ')', $productIds); 
     436        $results = array(); 
     437        foreach ($productStatus as $status) { 
     438            $results[$status['product_id']][] = $status['product_status_id']; 
     439        } 
     440        return $results; 
    423441    } 
    424442 
  • branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_Detail.php

    r18833 r18862  
    240240        $this->arrRelativeCat = $objDb->sfGetMultiCatTree($product_id); 
    241241 
     242        // 商品ステータスを取得 
     243        $this->productStatus = $objProduct->getProductStatus($product_id); 
     244 
    242245        // 画像ファイル指定がない場合の置換処理 
    243246        $this->arrProduct['main_image'] 
  • branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_List.php

    r18852 r18862  
    479479        $this->tpl_product_type = $objProduct->product_type; 
    480480 
     481        // 商品ステータスを取得 
     482        $this->productStatus = $objProduct->getProductStatus($arrProductId); 
     483 
    481484        $productsClassCategories = $objProduct->classCategories; 
    482485 
  • branches/version-2_5-dev/html/install/sql/insert_data.sql

    r18853 r18862  
    425425INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(18, 9, 4, 2); 
    426426 
    427 INSERT INTO dtb_product_status (product_status_id, product_id, creator_id, create_date, update_date, del_flg) VALUES (1, 1, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 2); 
     427INSERT INTO dtb_product_status (product_status_id, product_id, creator_id, create_date, update_date, del_flg) VALUES (1, 1, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0); 
    428428 
    429429INSERT INTO dtb_recommend_products (product_id, recommend_product_id, rank, comment, status, creator_id, create_date, update_date) VALUES (2, 1, 4, 'お口直しに。', 0, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); 
Note: See TracChangeset for help on using the changeset viewer.