Changeset 20381
- Timestamp:
- 2011/02/24 17:57:47 (13 years ago)
- 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
- 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 63 63 // 改行、タブを1スペースに変換 64 64 $sql = preg_replace("/[\r\n\t]/"," ",$sql); 65 // view表をインラインビューに変換する66 $sql = $this->sfChangeView($sql);67 65 // ILIKE検索をLIKE検索に変換する 68 66 $sql = $this->sfChangeILIKE($sql); … … 240 238 241 239 /** 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 private266 * @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 /**285 240 * ILIKE句 を LIKE句へ変換する. 286 241 * … … 335 290 } 336 291 return $sql; 337 }338 339 /**340 * WHERE 句置換用の配列を返す.341 *342 * @access private343 * @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 private361 * @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 SELECT373 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_count429 FROM430 dtb_products431 JOIN432 (433 SELECT434 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_count446 FROM dtb_products_class447 GROUP BY product_id448 ) AS T4449 ON dtb_products.product_id = T4.product_id450 )451 __EOS__;452 453 $sql['vw_products_allclass'] = <<< __EOS__454 (455 SELECT456 alldtl.*,457 dtb_category.rank AS category_rank,458 T2.category_id,459 T2.rank AS product_rank460 FROM461 {$sql['vw_products_allclass_detail']} AS alldtl462 LEFT JOIN463 dtb_product_categories AS T2464 ON alldtl.product_id = T2.product_id465 LEFT JOIN466 dtb_category467 ON T2.category_id = dtb_category.category_id468 )469 __EOS__;470 }471 472 return $sql;473 474 292 } 475 293 -
branches/version-2_5-dev/data/class/pages/admin/total/LC_Page_Admin_Total.php
r20345 r20381 23 23 // {{{ requires 24 24 require_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");26 25 require_once(CLASS_REALDIR . "graph/SC_GraphPie.php"); 27 26 require_once(CLASS_REALDIR . "graph/SC_GraphLine.php"); -
branches/version-2_5-dev/html/install/sql/create_table_mysql.sql
r20351 r20381 56 56 flg5 text, 57 57 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_TIMESTAMP69 58 ) ENGINE=InnoDB; 70 59 … … 406 395 ) ENGINE=InnoDB; 407 396 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 NULL430 ) 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_TIMESTAMP447 ) ENGINE=InnoDB;448 449 397 CREATE TABLE dtb_recommend_products ( 450 398 product_id int NOT NULL, … … 789 737 ) ENGINE=InnoDB; 790 738 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_TIMESTAMP796 ) ENGINE=InnoDB;797 798 739 CREATE TABLE dtb_pagelayout ( 799 740 device_type_id int NOT NULL, -
branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql
r20351 r20381 56 56 flg5 text, 57 57 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()69 58 ); 70 59 … … 406 395 ); 407 396 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 NULL430 );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 449 397 CREATE TABLE dtb_recommend_products ( 450 398 product_id int NOT NULL, … … 789 737 ); 790 738 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 798 739 CREATE TABLE dtb_pagelayout ( 799 740 device_type_id int NOT NULL, -
branches/version-2_5-dev/html/install/sql/drop_table.sql
r20329 r20381 1 1 DROP TABLE dtb_kiyaku; 2 2 DROP TABLE mtb_zip; 3 DROP TABLE dtb_bat_order_daily_age;4 3 DROP TABLE dtb_update; 5 4 DROP TABLE dtb_baseinfo; … … 19 18 DROP TABLE dtb_category; 20 19 DROP TABLE dtb_product_categories; 21 DROP TABLE dtb_bat_order_daily;22 DROP TABLE dtb_bat_order_daily_hour;23 20 DROP TABLE dtb_recommend_products; 24 21 DROP TABLE dtb_review; … … 39 36 DROP TABLE mtb_pref; 40 37 DROP TABLE dtb_member; 41 DROP TABLE dtb_bat_relate_products;42 38 DROP TABLE dtb_pagelayout; 43 39 DROP TABLE dtb_bloc;
Note: See TracChangeset
for help on using the changeset viewer.