Changeset 20381


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

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/pages/admin/total/LC_Page_Admin_Total.php 15600@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Ftotal%2FLC_Page_Admin_Total.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/drop_table.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Fdrop_table.sql
bzr:mapping-version:
v4
bzr:merge:

ohkouchi@loop-az.jp-20110224085226-wyz8zi0kzu0tp3nh
bzr:repository-uuid:
1e3b908f-19a9-db11-a64c-001125224ba8
bzr:revision-id:
ohkouchi@loop-az.jp-20110224085743-5jl1gn37tkawmr7k
bzr:revno:
3109
bzr:revprop:branch-nick:
branches/version-2_5-dev
bzr:root:
branches/version-2_5-dev
bzr:text-revisions:

data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php ohkouchi@loop-az.jp-20110224085226-wyz8zi0kzu0tp3nh
data/class/pages/admin/total/LC_Page_Admin_Total.php ohkouchi@loop-az.jp-20110224085226-wyz8zi0kzu0tp3nh
html/install/sql/create_table_mysql.sql ohkouchi@loop-az.jp-20110224085226-wyz8zi0kzu0tp3nh
html/install/sql/create_table_pgsql.sql ohkouchi@loop-az.jp-20110224085226-wyz8zi0kzu0tp3nh
html/install/sql/drop_table.sql ohkouchi@loop-az.jp-20110224085226-wyz8zi0kzu0tp3nh
bzr:timestamp:
2011-02-24 17:57:43.528000116 +0900
bzr:user-agent:
bzr2.2.1+bzr-svn1.0.4
svn:original-date:
2011-02-24T08:57:43.528000Z
Message:

#793 (非推奨機能の削除)

  • dtb_bat_* テーブル削除
  • r20351 に関連して, MySQL の VIEW 置換関数の削除
Location:
branches/version-2_5-dev
Files:
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php

    r20167 r20381  
    6363        // 改行、タブを1スペースに変換 
    6464        $sql = preg_replace("/[\r\n\t]/"," ",$sql); 
    65         // view表をインラインビューに変換する 
    66         $sql = $this->sfChangeView($sql); 
    6765        // ILIKE検索をLIKE検索に変換する 
    6866        $sql = $this->sfChangeILIKE($sql); 
     
    240238 
    241239    /** 
    242      * View の WHERE 句を置換する. 
    243      * 
    244      * @param string $target 置換対象の文字列 
    245      * @param string $where 置換する文字列 
    246      * @param array $arrval WHERE 句の要素の配列 
    247      * @param string $option SQL 文の追加文字列 
    248      * @return string 置換後の SQL 文 
    249      */ 
    250     function sfViewWhere($target, $where = "", $arrval = array(), $option = ""){ 
    251  
    252         $arrWhere = split("[?]", $where); 
    253         $where_tmp = " WHERE " . $arrWhere[0]; 
    254         for($i = 1; $i < count($arrWhere); $i++){ 
    255             $where_tmp .= SC_Utils_Ex::sfQuoteSmart($arrval[$i - 1]) . $arrWhere[$i]; 
    256         } 
    257         $arrWhere = $this->getWhereConverter(); 
    258         $arrWhere[$target] = $where_tmp . " " . $option; 
    259         return $arrWhere[$target]; 
    260     } 
    261  
    262     /** 
    263      * View をインラインビューに変換する. 
    264      * 
    265      * @access private 
    266      * @param string $sql SQL 文 
    267      * @return string インラインビューに変換した SQL 文 
    268      */ 
    269     function sfChangeView($sql){ 
    270  
    271         $arrViewTmp = $this->viewToSubQuery(); 
    272  
    273             // viewのwhereを変換 
    274         foreach($arrViewTmp as $key => $val){ 
    275             $arrViewTmp[$key] = strtr($arrViewTmp[$key], $this->getWhereConverter()); 
    276         } 
    277  
    278             // viewを変換 
    279         $changesql = strtr($sql, $arrViewTmp); 
    280  
    281         return $changesql; 
    282     } 
    283  
    284     /** 
    285240     * ILIKE句 を LIKE句へ変換する. 
    286241     * 
     
    335290        } 
    336291        return $sql; 
    337     } 
    338  
    339     /** 
    340      * WHERE 句置換用の配列を返す. 
    341      * 
    342      * @access private 
    343      * @return array WHERE 句置換用の配列 
    344      */ 
    345     function getWhereConverter() { 
    346         return array( 
    347             "&&crscls_where&&" => "", 
    348             "&&crsprdcls_where&&" =>"", 
    349             "&&noncls_where&&" => "", 
    350             "&&allcls_where&&" => "", 
    351             "&&allclsdtl_where&&" => "", 
    352             "&&prdcls_where&&" => "", 
    353             "&&catcnt_where&&" => "" 
    354         ); 
    355     } 
    356  
    357     /** 
    358      * View をサブクエリに変換するための配列を返す. 
    359      * 
    360      * @access private 
    361      * @return array View をサブクエリに変換するための配列 
    362      */ 
    363     function viewToSubQuery() { 
    364  
    365         static $sql = array(); 
    366  
    367         if (empty($sql)) { 
    368  
    369  
    370             $sql['vw_products_allclass_detail'] = <<< __EOS__ 
    371                 ( 
    372                     SELECT 
    373                         dtb_products.product_id, 
    374                         dtb_products.name, 
    375                         dtb_products.maker_id, 
    376                         dtb_products.status, 
    377                         dtb_products.comment1, 
    378                         dtb_products.comment2, 
    379                         dtb_products.comment3, 
    380                         dtb_products.comment4, 
    381                         dtb_products.comment5, 
    382                         dtb_products.comment6, 
    383                         dtb_products.note, 
    384                         dtb_products.main_list_comment, 
    385                         dtb_products.main_list_image, 
    386                         dtb_products.main_comment, 
    387                         dtb_products.main_image, 
    388                         dtb_products.main_large_image, 
    389                         dtb_products.sub_title1, 
    390                         dtb_products.sub_comment1, 
    391                         dtb_products.sub_image1, 
    392                         dtb_products.sub_large_image1, 
    393                         dtb_products.sub_title2, 
    394                         dtb_products.sub_comment2, 
    395                         dtb_products.sub_image2, 
    396                         dtb_products.sub_large_image2, 
    397                         dtb_products.sub_title3, 
    398                         dtb_products.sub_comment3, 
    399                         dtb_products.sub_image3, 
    400                         dtb_products.sub_large_image3, 
    401                         dtb_products.sub_title4, 
    402                         dtb_products.sub_comment4, 
    403                         dtb_products.sub_image4, 
    404                         dtb_products.sub_large_image4, 
    405                         dtb_products.sub_title5, 
    406                         dtb_products.sub_comment5, 
    407                         dtb_products.sub_image5, 
    408                         dtb_products.sub_large_image5, 
    409                         dtb_products.sub_title6, 
    410                         dtb_products.sub_comment6, 
    411                         dtb_products.sub_image6, 
    412                         dtb_products.sub_large_image6, 
    413                         dtb_products.del_flg, 
    414                         dtb_products.creator_id, 
    415                         dtb_products.create_date, 
    416                         dtb_products.update_date, 
    417                         dtb_products.deliv_date_id, 
    418                         T4.product_code_min, 
    419                         T4.product_code_max, 
    420                         T4.price01_min, 
    421                         T4.price01_max, 
    422                         T4.price02_min, 
    423                         T4.price02_max, 
    424                         T4.stock_min, 
    425                         T4.stock_max, 
    426                         T4.stock_unlimited_min, 
    427                         T4.stock_unlimited_max, 
    428                         T4.class_count 
    429                     FROM 
    430                         dtb_products 
    431                     JOIN 
    432                             ( 
    433                                 SELECT 
    434                                     product_id, 
    435                                     MIN(product_code) AS product_code_min, 
    436                                     MAX(product_code) AS product_code_max, 
    437                                     MIN(price01) AS price01_min, 
    438                                     MAX(price01) AS price01_max, 
    439                                     MIN(price02) AS price02_min, 
    440                                     MAX(price02) AS price02_max, 
    441                                     MIN(stock) AS stock_min, 
    442                                     MAX(stock) AS stock_max, 
    443                                     MIN(stock_unlimited) AS stock_unlimited_min, 
    444                                     MAX(stock_unlimited) AS stock_unlimited_max, 
    445                                     COUNT(*) as class_count 
    446                                 FROM dtb_products_class 
    447                                 GROUP BY product_id 
    448                             ) AS T4 
    449                             ON dtb_products.product_id = T4.product_id 
    450                 ) 
    451 __EOS__; 
    452  
    453             $sql['vw_products_allclass'] = <<< __EOS__ 
    454                 ( 
    455                     SELECT 
    456                         alldtl.*, 
    457                         dtb_category.rank AS category_rank, 
    458                         T2.category_id, 
    459                         T2.rank AS product_rank 
    460                     FROM 
    461                         {$sql['vw_products_allclass_detail']} AS alldtl 
    462                         LEFT JOIN 
    463                             dtb_product_categories AS T2 
    464                             ON alldtl.product_id = T2.product_id 
    465                         LEFT JOIN 
    466                             dtb_category 
    467                             ON T2.category_id = dtb_category.category_id 
    468                 ) 
    469 __EOS__; 
    470         } 
    471  
    472         return $sql; 
    473  
    474292    } 
    475293 
  • branches/version-2_5-dev/data/class/pages/admin/total/LC_Page_Admin_Total.php

    r20345 r20381  
    2323// {{{ requires 
    2424require_once(CLASS_EX_REALDIR . "page_extends/admin/LC_Page_Admin_Ex.php"); 
    25 require_once(CLASS_EX_REALDIR . "batch_extends/SC_Batch_Daily_Ex.php"); 
    2625require_once(CLASS_REALDIR . "graph/SC_GraphPie.php"); 
    2726require_once(CLASS_REALDIR . "graph/SC_GraphLine.php"); 
  • branches/version-2_5-dev/html/install/sql/create_table_mysql.sql

    r20351 r20381  
    5656    flg5 text, 
    5757    flg6 text 
    58 ) ENGINE=InnoDB; 
    59  
    60 CREATE TABLE dtb_bat_order_daily_age ( 
    61     order_count numeric NOT NULL DEFAULT 0, 
    62     total numeric NOT NULL DEFAULT 0, 
    63     total_average numeric NOT NULL DEFAULT 0, 
    64     start_age smallint, 
    65     end_age smallint, 
    66     member smallint, 
    67     order_date datetime, 
    68     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP 
    6958) ENGINE=InnoDB; 
    7059 
     
    406395) ENGINE=InnoDB; 
    407396 
    408 CREATE TABLE dtb_bat_order_daily ( 
    409     total_order numeric NOT NULL DEFAULT 0, 
    410     member numeric NOT NULL DEFAULT 0, 
    411     nonmember numeric NOT NULL DEFAULT 0, 
    412     men numeric NOT NULL DEFAULT 0, 
    413     women numeric NOT NULL DEFAULT 0, 
    414     men_member numeric NOT NULL DEFAULT 0, 
    415     men_nonmember numeric NOT NULL DEFAULT 0, 
    416     women_member numeric NOT NULL DEFAULT 0, 
    417     women_nonmember numeric NOT NULL DEFAULT 0, 
    418     total numeric NOT NULL DEFAULT 0, 
    419     total_average numeric NOT NULL DEFAULT 0, 
    420     order_date datetime NOT NULL, 
    421     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 
    422     year smallint NOT NULL, 
    423     month smallint NOT NULL, 
    424     day smallint NOT NULL, 
    425     wday smallint NOT NULL, 
    426     key_day text NOT NULL, 
    427     key_month text NOT NULL, 
    428     key_year text NOT NULL, 
    429     key_wday text NOT NULL 
    430 ) ENGINE=InnoDB; 
    431  
    432 CREATE TABLE dtb_bat_order_daily_hour ( 
    433     total_order numeric NOT NULL DEFAULT 0, 
    434     member numeric NOT NULL DEFAULT 0, 
    435     nonmember numeric NOT NULL DEFAULT 0, 
    436     men numeric NOT NULL DEFAULT 0, 
    437     women numeric NOT NULL DEFAULT 0, 
    438     men_member numeric NOT NULL DEFAULT 0, 
    439     men_nonmember numeric NOT NULL DEFAULT 0, 
    440     women_member numeric NOT NULL DEFAULT 0, 
    441     women_nonmember numeric NOT NULL DEFAULT 0, 
    442     total numeric NOT NULL DEFAULT 0, 
    443     total_average numeric NOT NULL DEFAULT 0, 
    444     hour smallint NOT NULL DEFAULT 0, 
    445     order_date datetime, 
    446     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP 
    447 ) ENGINE=InnoDB; 
    448  
    449397CREATE TABLE dtb_recommend_products ( 
    450398    product_id int NOT NULL, 
     
    789737) ENGINE=InnoDB; 
    790738 
    791 CREATE TABLE dtb_bat_relate_products ( 
    792     product_id int, 
    793     relate_product_id int, 
    794     customer_id int, 
    795     create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP 
    796 ) ENGINE=InnoDB; 
    797  
    798739CREATE TABLE dtb_pagelayout ( 
    799740    device_type_id int NOT NULL, 
  • branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql

    r20351 r20381  
    5656    flg5 text, 
    5757    flg6 text 
    58 ); 
    59  
    60 CREATE TABLE dtb_bat_order_daily_age ( 
    61     order_count numeric NOT NULL DEFAULT 0, 
    62     total numeric NOT NULL DEFAULT 0, 
    63     total_average numeric NOT NULL DEFAULT 0, 
    64     start_age smallint, 
    65     end_age smallint, 
    66     member smallint, 
    67     order_date timestamp, 
    68     create_date timestamp NOT NULL DEFAULT now() 
    6958); 
    7059 
     
    406395); 
    407396 
    408 CREATE TABLE dtb_bat_order_daily ( 
    409     total_order numeric NOT NULL DEFAULT 0, 
    410     member numeric NOT NULL DEFAULT 0, 
    411     nonmember numeric NOT NULL DEFAULT 0, 
    412     men numeric NOT NULL DEFAULT 0, 
    413     women numeric NOT NULL DEFAULT 0, 
    414     men_member numeric NOT NULL DEFAULT 0, 
    415     men_nonmember numeric NOT NULL DEFAULT 0, 
    416     women_member numeric NOT NULL DEFAULT 0, 
    417     women_nonmember numeric NOT NULL DEFAULT 0, 
    418     total numeric NOT NULL DEFAULT 0, 
    419     total_average numeric NOT NULL DEFAULT 0, 
    420     order_date timestamp NOT NULL, 
    421     create_date timestamp NOT NULL DEFAULT now(), 
    422     year smallint NOT NULL, 
    423     month smallint NOT NULL, 
    424     day smallint NOT NULL, 
    425     wday smallint NOT NULL, 
    426     key_day text NOT NULL, 
    427     key_month text NOT NULL, 
    428     key_year text NOT NULL, 
    429     key_wday text NOT NULL 
    430 ); 
    431  
    432 CREATE TABLE dtb_bat_order_daily_hour ( 
    433     total_order numeric NOT NULL DEFAULT 0, 
    434     member numeric NOT NULL DEFAULT 0, 
    435     nonmember numeric NOT NULL DEFAULT 0, 
    436     men numeric NOT NULL DEFAULT 0, 
    437     women numeric NOT NULL DEFAULT 0, 
    438     men_member numeric NOT NULL DEFAULT 0, 
    439     men_nonmember numeric NOT NULL DEFAULT 0, 
    440     women_member numeric NOT NULL DEFAULT 0, 
    441     women_nonmember numeric NOT NULL DEFAULT 0, 
    442     total numeric NOT NULL DEFAULT 0, 
    443     total_average numeric NOT NULL DEFAULT 0, 
    444     hour smallint NOT NULL DEFAULT 0, 
    445     order_date timestamp, 
    446     create_date timestamp NOT NULL DEFAULT now() 
    447 ); 
    448  
    449397CREATE TABLE dtb_recommend_products ( 
    450398    product_id int NOT NULL, 
     
    789737); 
    790738 
    791 CREATE TABLE dtb_bat_relate_products ( 
    792     product_id int, 
    793     relate_product_id int, 
    794     customer_id int, 
    795     create_date timestamp NOT NULL DEFAULT now() 
    796 ); 
    797  
    798739CREATE TABLE dtb_pagelayout ( 
    799740    device_type_id int NOT NULL, 
  • branches/version-2_5-dev/html/install/sql/drop_table.sql

    r20329 r20381  
    11DROP TABLE dtb_kiyaku; 
    22DROP TABLE mtb_zip; 
    3 DROP TABLE dtb_bat_order_daily_age; 
    43DROP TABLE dtb_update; 
    54DROP TABLE dtb_baseinfo; 
     
    1918DROP TABLE dtb_category; 
    2019DROP TABLE dtb_product_categories; 
    21 DROP TABLE dtb_bat_order_daily; 
    22 DROP TABLE dtb_bat_order_daily_hour; 
    2320DROP TABLE dtb_recommend_products; 
    2421DROP TABLE dtb_review; 
     
    3936DROP TABLE mtb_pref; 
    4037DROP TABLE dtb_member; 
    41 DROP TABLE dtb_bat_relate_products; 
    4238DROP TABLE dtb_pagelayout; 
    4339DROP TABLE dtb_bloc; 
Note: See TracChangeset for help on using the changeset viewer.