Ignore:
Timestamp:
2010/09/20 20:40:27 (16 years ago)
Author:
nanasess
bzr:base-revision:
svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:18814
bzr:committer:
Kentaro Ohkouchi <[email protected]>
bzr:file-ids:

data/Smarty/templates/default/admin/products/product_class.tpl 15732@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2FSmarty%2Ftemplates%2Fdefault%2Fadmin%2Fproducts%2Fproduct_class.tpl
data/class/SC_Initial.php 16506@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2FSC_Initial.php
data/class/SC_Product.php 18277@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcomu-ver2%2Fdata%2Fclass%2FSC_Product.php
data/class/SC_Query.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2FSC_Query.php
data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php 15123@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fdb%2Fdbfactory%2FSC_DB_DBFactory_MYSQL.php
data/class/helper/SC_Helper_CSV.php 15535@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fhelper%2FSC_Helper_CSV.php
data/class/helper/SC_Helper_DB.php 15176@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fhelper%2FSC_Helper_DB.php
data/class/pages/admin/contents/LC_Page_Admin_Contents_RecommendSearch.php 15661@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fcontents%2FLC_Page_Admin_Contents_RecommendSearch.php
data/class/pages/admin/customer/LC_Page_Admin_Customer.php 15568@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fcustomer%2FLC_Page_Admin_Customer.php
data/class/pages/admin/mail/LC_Page_Admin_Mail.php 15640@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fmail%2FLC_Page_Admin_Mail.php
data/class/pages/admin/mail/LC_Page_Admin_Mail_Preview.php 15654@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fmail%2FLC_Page_Admin_Mail_Preview.php
data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php 17293@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcomu-ver2%2Fdata%2Fclass%2Fpages%2Fadmin%2Forder%2FLC_Page_Admin_Order_ProductSelect.php
data/class/pages/admin/products/LC_Page_Admin_Products.php 15342@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fproducts%2FLC_Page_Admin_Products.php
data/class/pages/admin/products/LC_Page_Admin_Products_Product.php 15342@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fproducts%2FLC_Page_Admin_Products_Product.php
data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php 15559@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fproducts%2FLC_Page_Admin_Products_ProductClass.php
data/class/pages/admin/products/LC_Page_Admin_Products_ProductRank.php 15526@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fproducts%2FLC_Page_Admin_Products_ProductRank.php
data/class/pages/admin/products/LC_Page_Admin_Products_ProductSelect.php 15557@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fproducts%2FLC_Page_Admin_Products_ProductSelect.php
data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Best5.php 15367@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Ffrontparts%2Fbloc%2FLC_Page_FrontParts_Bloc_Best5.php
data/class/pages/mypage/LC_Page_Mypage_Favorite.php 17162@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcomu-ver2%2Fdata%2Fclass%2Fpages%2Fmypage%2FLC_Page_Mypage_Favorite.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
data/class/pages/rss/LC_Page_Rss_Products.php 16193@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Frss%2FLC_Page_Rss_Products.php
data/class/pages/shopping/LC_Page_Shopping_Complete.php 15223@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fshopping%2FLC_Page_Shopping_Complete.php
data/class/util/SC_Utils.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Futil%2FSC_Utils.php
data/install.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Finstall.php
data/require_classes.php 18500@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fversion-2_4-dev%2Fdata%2Frequire_classes.php
html/admin/require.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Fadmin%2Frequire.php
html/handle_error.php 18500@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fversion-2_4-dev%2Fhtml%2Fhandle_error.php
html/install/index.php 16809@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Findex.php
html/install/sql/create_table_mysql.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Fcreate_table_mysql.sql
html/install/sql/create_table_pgsql.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Fcreate_table_pgsql.sql
html/install/sql/create_view.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Fcreate_view.sql
html/install/sql/drop_table.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Fdrop_table.sql
html/install/sql/drop_view.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Fdrop_view.sql
html/install/sql/insert_data.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Finsert_data.sql
html/require.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Frequire.php
test/class/page/LC_Page_Admin_Products_ProductClass_Test.php lc_page_admin_produc-20100910101923-ux7d8xbbsd4inq1c-1
bzr:mapping-version:
v4
bzr:merge:

[email protected]
bzr:repository-uuid:
1e3b908f-19a9-db11-a64c-001125224ba8
bzr:revision-id:
[email protected]
bzr:revno:
2298
bzr:revprop:branch-nick:
branches/version-2_5-dev
bzr:root:
branches/version-2_5-dev
bzr:text-parents:

data/Smarty/templates/default/admin/products/product_class.tpl [email protected]
data/class/SC_Initial.php svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:18795 [email protected]
data/class/SC_Product.php [email protected]
data/class/SC_Query.php svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:18813 [email protected]
data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php [email protected]
data/class/helper/SC_Helper_CSV.php [email protected]
data/class/helper/SC_Helper_DB.php [email protected]
data/class/pages/admin/contents/LC_Page_Admin_Contents_RecommendSearch.php [email protected]
data/class/pages/admin/customer/LC_Page_Admin_Customer.php [email protected]
data/class/pages/admin/mail/LC_Page_Admin_Mail.php svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:18798 [email protected]
data/class/pages/admin/mail/LC_Page_Admin_Mail_Preview.php [email protected]
data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php [email protected]
data/class/pages/admin/products/LC_Page_Admin_Products.php [email protected]
data/class/pages/admin/products/LC_Page_Admin_Products_Product.php [email protected]
data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php [email protected]
data/class/pages/admin/products/LC_Page_Admin_Products_ProductRank.php [email protected]
data/class/pages/admin/products/LC_Page_Admin_Products_ProductSelect.php [email protected]
data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Best5.php [email protected]
data/class/pages/mypage/LC_Page_Mypage_Favorite.php [email protected]
data/class/pages/products/LC_Page_Products_Detail.php [email protected]
data/class/pages/products/LC_Page_Products_List.php [email protected]
data/class/pages/rss/LC_Page_Rss_Products.php [email protected]
data/class/pages/shopping/LC_Page_Shopping_Complete.php [email protected]
data/class/util/SC_Utils.php svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:18812 [email protected]
data/install.php [email protected]
data/require_classes.php [email protected]
html/admin/require.php [email protected] [email protected]
html/handle_error.php [email protected] [email protected]
html/install/index.php [email protected]
html/install/sql/create_table_mysql.sql [email protected]
html/install/sql/create_table_pgsql.sql [email protected]
html/install/sql/create_view.sql [email protected]
html/install/sql/drop_table.sql [email protected]
html/install/sql/drop_view.sql [email protected]
html/install/sql/insert_data.sql [email protected]
html/require.php [email protected] [email protected]
bzr:text-revisions:

data/Smarty/templates/default/admin/products/product_class.tpl [email protected]
data/class/SC_Product.php [email protected]
data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php [email protected]
data/class/helper/SC_Helper_CSV.php [email protected]
data/class/pages/admin/contents/LC_Page_Admin_Contents_RecommendSearch.php [email protected]
data/class/pages/admin/customer/LC_Page_Admin_Customer.php [email protected]
data/class/pages/admin/mail/LC_Page_Admin_Mail_Preview.php [email protected]
data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php [email protected]
data/class/pages/admin/products/LC_Page_Admin_Products.php [email protected]
data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php [email protected]
data/class/pages/admin/products/LC_Page_Admin_Products_ProductRank.php [email protected]
data/class/pages/admin/products/LC_Page_Admin_Products_ProductSelect.php [email protected]
data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Best5.php [email protected]
data/class/pages/mypage/LC_Page_Mypage_Favorite.php [email protected]
data/class/pages/products/LC_Page_Products_Detail.php [email protected]
data/class/pages/products/LC_Page_Products_List.php [email protected]
data/class/pages/rss/LC_Page_Rss_Products.php [email protected]
data/class/pages/shopping/LC_Page_Shopping_Complete.php [email protected]
data/require_classes.php [email protected]
html/install/index.php [email protected]
html/install/sql/create_table_mysql.sql [email protected]
html/install/sql/create_table_pgsql.sql [email protected]
html/install/sql/create_view.sql [email protected]
html/install/sql/drop_table.sql [email protected]
html/install/sql/drop_view.sql [email protected]
html/install/sql/insert_data.sql [email protected]
test/class/page/LC_Page_Admin_Products_ProductClass_Test.php [email protected]
bzr:timestamp:
2010-09-20 20:39:58.994999886 +0900
bzr:user-agent:
bzr2.1.1+bzr-svn1.0.2
svn:original-date:
2010-09-20T11:39:58.995000Z
Message:

規格まわりの内部構成変更に伴う修正(#781)

  • 規格のデータ構造を木構造へ変更
  • 商品検索ロジックを SC_Product クラスへできるだけ集約
  • 以下の VIEW を削除
    • vw_category_count;
    • vw_product_class;
    • vw_products_nonclass;
    • vw_cross_products_class;
    • vw_cross_class;
    • vw_download_class;
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php

    r18790 r18815  
    185185     * 商品規格情報を取得する. 
    186186     * 
     187     * TODO SC_Product クラスへ移動 
     188     * 
    187189     * @param array $arrID 規格ID 
    188190     * @param boolean $includePrivateProducts 非公開商品を含むか 
     
    193195 
    194196        if (strlen($classcategory_id1) == 0) { 
    195             $classcategory_id1 = '0'; 
     197            $classcategory_id1 = null; 
    196198        } 
    197199        if (strlen($classcategory_id2) == 0) { 
    198             $classcategory_id2 = '0'; 
     200            $classcategory_id2 = null; 
    199201        } 
    200202 
    201203        // 商品規格取得 
    202         $objQuery =& SC_Query::getSingletonInstance(); 
    203         $col = 'product_id, deliv_fee, name, product_code, main_list_image, main_image, price01, price02, point_rate, product_class_id, classcategory_id1, classcategory_id2, class_id1, class_id2, stock, stock_unlimited, sale_limit'; 
    204         $table = 'vw_product_class AS prdcls'; 
    205         $where = 'product_id = ? AND classcategory_id1 = ? AND classcategory_id2 = ?'; 
    206         if (!$includePrivateProducts) { 
    207              $where .= ' AND status = 1'; 
    208         } 
    209         $arrRet = $objQuery->select($col, $table, $where, array($product_id, $classcategory_id1, $classcategory_id2)); 
    210         return $arrRet[0]; 
     204        $objProduct = new SC_Product(); 
     205        $detail = $objProduct->getDetail($product_id); 
     206        $productsClass = $objProduct->getProductsClassFullByProductId($product_id); 
     207        foreach ($productsClass as $val) { 
     208 
     209            if ($val['classcategory_id1'] == $classcategory_id1 
     210                && $val['classcategory_id2'] == $classcategory_id2) { 
     211 
     212                $detail = array_merge($val, $detail); 
     213                if (!$includePrivateProducts) { 
     214                    if ($detail['status'] == 1) { 
     215                        return $detail; 
     216                    } 
     217                } 
     218                return $detail; 
     219            } 
     220        } 
    211221    } 
    212222 
     
    912922        } 
    913923 
    914         //各カテゴリ内の商品数を数えて格納 
    915         $sql = <<< __EOS__ 
    916             INSERT INTO dtb_category_count(category_id, product_count, create_date) 
    917             SELECT T1.category_id, count(T2.category_id), now() 
    918             FROM dtb_category AS T1 
    919                 LEFT JOIN dtb_product_categories AS T2 
    920                     ON T1.category_id = T2.category_id 
    921                 LEFT JOIN vw_products_allclass_detail AS alldtl 
    922                     ON T2.product_id = alldtl.product_id 
    923             WHERE $sql_where 
    924             GROUP BY T1.category_id, T2.category_id 
    925 __EOS__; 
    926  
    927         $objQuery->query($sql); 
    928  
    929924        //子カテゴリ内の商品数を集計する 
    930925 
    931926        // カテゴリ情報を取得 
    932927        $arrCat = $objQuery->select('category_id', 'dtb_category'); 
     928 
     929        $objProduct = new SC_Product(); 
    933930 
    934931        foreach ($arrCat as $row) { 
     
    940937            list($tmp_where, $tmp_arrval) = $this->sfGetCatWhere($category_id); 
    941938            if ($tmp_where != "") { 
    942                 $sql_where_product_ids = "alldtl.product_id IN (SELECT product_id FROM dtb_product_categories WHERE " . $tmp_where . ")"; 
    943                 $arrval = array_merge((array)$arrval, (array)$tmp_arrval); 
     939                $sql_where_product_ids = "product_id IN (SELECT product_id FROM dtb_product_categories WHERE " . $tmp_where . ")"; 
     940                $arrval = array_merge((array)$arrval, (array)$tmp_arrval, (array)$tmp_arrval); 
    944941            } else { 
    945942                $sql_where_product_ids = '0<>0'; // 一致させない 
    946943            } 
    947  
     944            $where = "($sql_where) AND ($sql_where_product_ids)"; 
     945 
     946            $from = $objProduct->alldtlSQL($sql_where_product_ids); 
    948947            $sql = <<< __EOS__ 
    949948                INSERT INTO dtb_category_total_count (category_id, product_count, create_date) 
     
    952951                    ,count(*) 
    953952                    ,now() 
    954                 FROM vw_products_allclass_detail AS alldtl 
    955                 WHERE ($sql_where) AND ($sql_where_product_ids) 
     953                FROM $from 
     954               WHERE $where 
    956955__EOS__; 
    957956 
     
    986985        $objQuery =& SC_Query::getSingletonInstance(); 
    987986        $col = $pid_name . "," . $id_name; 
    988          $arrData = $objQuery->select($col, $table); 
     987        $arrData = $objQuery->select($col, $table); 
    989988 
    990989        $arrPID = array(); 
     
    19101909 
    19111910        $objQuery =& SC_Query::getSingletonInstance(); 
    1912         $where = 'product_id = ? AND (classcategory_id1 <> 0 OR classcategory_id2 <> 0)'; 
     1911        $where = 'product_id = ? AND class_combination_id IS NOT NULL'; 
    19131912        $count = $objQuery->count('dtb_products_class', $where, array($product_id)); 
    19141913 
Note: See TracChangeset for help on using the changeset viewer.