Changeset 21499
- Timestamp:
- 2012/02/13 17:25:35 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/patches/no_tree.patch
r21434 r21499 1 1 Index: data/class/helper/SC_Helper_DB.php 2 2 =================================================================== 3 --- data/class/helper/SC_Helper_DB.php (revision 214 33)3 --- data/class/helper/SC_Helper_DB.php (revision 21496) 4 4 +++ data/class/helper/SC_Helper_DB.php (working copy) 5 5 @@ -1437,7 +1437,7 @@ … … 14 14 Index: data/class/pages/admin/products/LC_Page_Admin_Products_Product.php 15 15 =================================================================== 16 --- data/class/pages/admin/products/LC_Page_Admin_Products_Product.php (revision 214 33)16 --- data/class/pages/admin/products/LC_Page_Admin_Products_Product.php (revision 21496) 17 17 +++ data/class/pages/admin/products/LC_Page_Admin_Products_Product.php (working copy) 18 18 @@ -1048,32 +1048,14 @@ 19 19 $objQuery->setOrder('product_class_id'); 20 $arrProductsClass = $objQuery->select($col, $table, $where, array($arrList[ "copy_product_id"]));20 $arrProductsClass = $objQuery->select($col, $table, $where, array($arrList['copy_product_id'])); 21 21 22 22 - // 複製元商品の規格組み合わせデータ登録 … … 26 26 // 規格データ登録 27 27 $objQuery =& SC_Query_Ex::getSingletonInstance(); 28 foreach ($arrProductsClass as $arrData) {28 foreach ($arrProductsClass as $arrData) { 29 29 - $sqlval = array(); 30 30 + $sqlval = $arrData; … … 69 69 - 70 70 - // 規格組み合わせデータを複製登録 71 - if ($has_class2 == true) {71 - if ($has_class2 == true) { 72 72 - // 規格2を持っている場合、規格1の組み合わせデータも取得 73 73 - $arrClassCombinationParent = $this->lfGetClassCombination($arrClassCombination, true); … … 94 94 - $has_class2 = false; 95 95 - 96 - foreach ($arrClassCombination as $arrVal) {97 - if ($arrVal['level'] == '2') {96 - foreach ($arrClassCombination as $arrVal) { 97 - if ($arrVal['level'] == '2') { 98 98 - $has_class2 = true; 99 99 - break; … … 114 114 - $objQuery =& SC_Query_Ex::getSingletonInstance(); 115 115 - $key = 'class_combination_id'; 116 - if ($is_parent == true) {116 - if ($is_parent == true) { 117 117 - $key = 'parent_class_combination_id'; 118 118 - } … … 120 120 - $where = 'class_combination_id IN ('; 121 121 - $arrParam = array(); 122 - foreach ($arrData as $arrVal) {123 - if (SC_Utils_Ex::isBlank($arrVal[$key]) == true) {122 - foreach ($arrData as $arrVal) { 123 - if (SC_Utils_Ex::isBlank($arrVal[$key]) == true) { 124 124 - continue; 125 125 - } … … 145 145 - 146 146 - // 親組み合わせIDの指定がある場合、指定された親組み合わせIDで複製登録 147 - if (count($arrParentCombinationId) > 0) {148 - foreach ($arrClassCombination as $key => $arrVal) {147 - if (count($arrParentCombinationId) > 0) { 148 - foreach ($arrClassCombination as $key => $arrVal) { 149 149 - $arrClassCombination[$key]['parent_class_combination_id'] = $arrParentCombinationId[$arrVal['parent_class_combination_id']]; 150 150 - } 151 151 - } 152 152 - 153 - foreach ($arrClassCombination as $arrVal) {153 - foreach ($arrClassCombination as $arrVal) { 154 154 - $sqlval = array(); 155 155 - $sqlval['class_combination_id'] = $objQuery->nextVal('dtb_class_combination_class_combination_id'); … … 171 171 Index: data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php 172 172 =================================================================== 173 --- data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php (revision 214 33)173 --- data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php (revision 21496) 174 174 +++ data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php (working copy) 175 175 @@ -236,16 +236,18 @@ … … 235 235 $arrBlank['del_flg'] = 1; 236 236 $arrBlank['update_date'] = 'CURRENT_TIMESTAMP'; 237 $objQuery->update( "dtb_products_class", $arrBlank,237 $objQuery->update('dtb_products_class', $arrBlank, 238 238 - "product_id = ? AND class_combination_id IS NULL", 239 239 + "product_id = ? AND classcategory_id1 = 0 AND classcategory_id2 = 0", … … 274 274 - $existsCombi['parent_class_combination_id'])); 275 275 - } 276 - $objQuery->update( "dtb_products_class", array('del_flg' => 0),276 - $objQuery->update('dtb_products_class', array('del_flg' => 0), 277 277 - "product_id = ? AND class_combination_id IS NULL", 278 278 - array($product_id)); 279 - $objQuery->delete( "dtb_products_class",279 - $objQuery->delete('dtb_products_class', 280 280 - "product_id = ? AND class_combination_id IS NOT NULL", 281 281 - array($product_id)); … … 291 291 $objQuery =& SC_Query_Ex::getSingletonInstance(); 292 292 $col = "product_code, price01, price02, stock, stock_unlimited, sale_limit, deliv_fee, point_rate"; 293 - return $objQuery->getRow($col, "dtb_products_class", "product_id = ? AND class_combination_id IS NULL", array($product_id));293 - return $objQuery->getRow($col, 'dtb_products_class', "product_id = ? AND class_combination_id IS NULL", array($product_id)); 294 294 + $where = 'product_id = ? AND classcategory_id1 = 0 AND classcategory_id2 = 0'; 295 + return $objQuery->getRow($col, "dtb_products_class", $where, array($product_id));295 + return $objQuery->getRow($col, 'dtb_products_class', $where, array($product_id)); 296 296 } 297 297 … … 299 299 Index: data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php 300 300 =================================================================== 301 --- data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php (revision 214 33)301 --- data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php (revision 21496) 302 302 +++ data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php (working copy) 303 @@ -61 3,6 +613,7 @@303 @@ -612,6 +612,7 @@ 304 304 */ 305 305 function lfCheckErrorDetail($item, $arrErr) { 306 306 // 規格IDの存在チェック 307 307 + // FIXME 規格分類ID自体のが有効かを主眼においたチェックをすべきと感じる。 308 if (!$this->lfIsDbRecord('dtb_products_class', 'product_class_id', $item)) {308 if (!$this->lfIsDbRecord('dtb_products_class', 'product_class_id', $item)) { 309 309 $arrErr['product_class_id'] = "※ 指定の商品規格IDは、登録されていません。"; 310 310 } 311 @@ -62 8,17 +629,6 @@311 @@ -627,17 +628,6 @@ 312 312 } 313 313 } 314 314 } 315 315 - // 規格組合せIDの存在チェック 316 -// if (!$this->lfIsDbRecord('dtb_class_combination', 'class_combination_id', $item)) {316 -// if (!$this->lfIsDbRecord('dtb_class_combination', 'class_combination_id', $item)) { 317 317 -// SC_Utils::sfIsRecord が del_flg が無いと使えない為、個別処理 318 318 - if(array_search('class_combination_id', $this->arrFormKeyList) !== FALSE 319 - and $item['class_combination_id'] != "" 319 - and $item['class_combination_id'] != "") { 320 320 - $objQuery =& SC_Query_Ex::getSingletonInstance(); 321 321 - $ret = $objQuery->get('class_combination_id', 'dtb_class_combination', 'class_combination_id = ?', array($item['class_combination_id'])); 322 - if ($ret == "") {322 - if ($ret == "") { 323 323 - $arrErr['class_combination_id'] = "※ 指定の規格組合せIDは、登録されていません。"; 324 324 - } 325 325 - } 326 326 // 表示ステータスの存在チェック 327 if (!$this->lfIsArrayRecord($this->arrDISP, 'status', $item)) {327 if (!$this->lfIsArrayRecord($this->arrDISP, 'status', $item)) { 328 328 $arrErr['status'] = "※ 指定の表示ステータスは、登録されていません。"; 329 329 Index: data/class/SC_Product.php 330 330 =================================================================== 331 --- data/class/SC_Product.php (revision 214 33)331 --- data/class/SC_Product.php (revision 21496) 332 332 +++ data/class/SC_Product.php (working copy) 333 333 @@ -258,9 +258,9 @@ … … 455 455 456 456 /** 457 @@ -788,7 +735,7 @@ 457 @@ -448,9 +395,8 @@ 458 function getProductsClass($productClassId) { 459 $objQuery =& SC_Query_Ex::getSingletonInstance(); 460 $objQuery->setWhere('product_class_id = ? AND T1.del_flg = 0'); 461 - $results = $this->getProductsClassByQuery($objQuery, $productClassId); 462 - $productsClass = $this->getProductsClassFull($results); 463 - return $productsClass[0]; 464 + $arrRes = $this->getProductsClassByQuery($objQuery, $productClassId); 465 + return $arrRes[0]; 466 } 467 468 /** 469 @@ -474,17 +420,6 @@ 470 } 471 472 /** 473 - * 商品IDに紐づいた, 商品規格を階層ごとに取得する. 474 - * 475 - * @param array $productId 商品ID 476 - * @return array 階層ごとの商品規格の配列 477 - */ 478 - function getProductsClassLevelByProductId($productId) { 479 - $results = $this->getProductsClassByProductIds(array($productId)); 480 - return $this->getProductsClassLevel($results); 481 - } 482 - 483 - /** 484 * 商品IDに紐づいた, 商品規格をすべての組み合わせごとに取得する. 485 * 486 * @param array $productId 商品ID 487 @@ -492,51 +427,11 @@ 488 * @return array すべての組み合わせの商品規格の配列 489 */ 490 function getProductsClassFullByProductId($productId, $has_deleted = false) { 491 - $results = $this->getProductsClassByProductIds(array($productId), $has_deleted); 492 - return $this->getProductsClassFull($results); 493 + $arrRet = $this->getProductsClassByProductIds(array($productId), $has_deleted); 494 + return $arrRet; 495 } 496 497 /** 498 - * 商品規格の配列から, 商品規格を階層ごとに取得する. 499 - * 500 - * @access private 501 - * @param array $productsClassResults 商品規格の結果の配列 502 - * @return array 階層ごとの商品規格の配列 503 - */ 504 - function getProductsClassLevel($productsClassResults) { 505 - foreach ($productsClassResults as $row) { 506 - $productsClassLevel['level' . $row['level']][] = $row; 507 - } 508 - return $productsClassLevel; 509 - } 510 - 511 - /** 512 - * 商品規格の配列から, 商品規格のすべての組み合わせを取得する. 513 - * 514 - * @access private 515 - * @param array $productsClassResults 商品規格の結果の配列 516 - * @ array 階層ごとの商品規格の配列 517 - */ 518 - function getProductsClassFull($productsClassResults) { 519 - $results = $this->getProductsClassLevel($productsClassResults); 520 - $productsClass = array(); 521 - if (SC_Utils_Ex::isBlank($results['level1']) 522 - && SC_Utils_Ex::isBlank($results['level2'])) { 523 - return $results['level']; 524 - } 525 - 526 - foreach ($results['level1'] as $level1) { 527 - foreach ($results['level2'] as $level2) { 528 - if ($level2['parent_class_combination_id'] == $level1['class_combination_id']) { 529 - $level1 = array_merge($level1, $level2); 530 - } 531 - } 532 - $productsClass[] = $level1; 533 - } 534 - return $productsClass; 535 - } 536 - 537 - /** 538 * 商品IDをキーにした, 商品ステータスIDの配列を取得する. 539 * 540 * @param array 商品ID の配列 541 @@ -786,7 +681,6 @@ 458 542 ( 459 543 SELECT dtb_products.*, 460 544 dtb_products_class.product_class_id, 461 545 - dtb_products_class.class_combination_id, 462 + 'dummy' AS class_combination_id,463 546 dtb_products_class.product_type_id, 464 547 dtb_products_class.product_code, 465 548 dtb_products_class.stock, 466 @@ - 800,11 +747,13@@549 @@ -798,11 +692,10 @@ 467 550 dtb_products_class.point_rate, 468 551 dtb_products_class.down_filename, … … 473 556 - Tpcm.classcategory_id as parent_classcategory_id, 474 557 - Tpcm.level as parent_classlevel, 475 + 'dummy' AS parent_class_combination_id, -- 削除476 558 + dtb_products_class.classcategory_id1 AS classcategory_id, -- 削除 477 559 + dtb_products_class.classcategory_id1, 478 + 'dummy' as classlevel, -- 削除479 560 + dtb_products_class.classcategory_id2 AS parent_classcategory_id, -- 削除 480 561 + dtb_products_class.classcategory_id2, 481 + 'dummy' as parent_classlevel, -- 削除482 562 Tcc1.class_id as class_id, 483 563 Tcc1.name as classcategory_name, 484 564 Tcc2.class_id as parent_class_id, 485 @@ -81 2,14 +761,10 @@565 @@ -810,14 +703,10 @@ 486 566 FROM dtb_products 487 567 LEFT JOIN dtb_products_class … … 502 582 Index: html/install/index.php 503 583 =================================================================== 504 --- html/install/index.php (revision 214 30)584 --- html/install/index.php (revision 21496) 505 585 +++ html/install/index.php (working copy) 506 @@ -10 53,7 +1053,6 @@507 array("dtb_payment", "payment_id"),508 array("dtb_products_class", "product_class_id"),509 array("dtb_products", "product_id"),510 - array("dtb_class_combination", "class_combination_id"),511 array("dtb_review", "review_id"),512 array("dtb_send_history", "send_id"),513 array("dtb_mailmaga_template", "template_id"));586 @@ -1045,7 +1045,6 @@ 587 array('dtb_payment', 'payment_id'), 588 array('dtb_products_class', 'product_class_id'), 589 array('dtb_products', 'product_id'), 590 - array('dtb_class_combination', 'class_combination_id'), 591 array('dtb_review', 'review_id'), 592 array('dtb_send_history', 'send_id'), 593 array('dtb_mailmaga_template', 'template_id'), 514 594 Index: html/install/sql/create_table_mysql.sql 515 595 =================================================================== 516 --- html/install/sql/create_table_mysql.sql (revision 214 30)596 --- html/install/sql/create_table_mysql.sql (revision 21496) 517 597 +++ html/install/sql/create_table_mysql.sql (working copy) 518 @@ -3 15,7 +315,8 @@598 @@ -304,7 +304,8 @@ 519 599 CREATE TABLE dtb_products_class ( 520 600 product_class_id int NOT NULL, … … 526 606 product_code text, 527 607 stock numeric, 528 @@ -3 57,14 +358,6 @@608 @@ -346,14 +347,6 @@ 529 609 PRIMARY KEY (classcategory_id) 530 610 ) ENGINE=InnoDB; … … 543 623 Index: html/install/sql/create_table_pgsql.sql 544 624 =================================================================== 545 --- html/install/sql/create_table_pgsql.sql (revision 214 30)625 --- html/install/sql/create_table_pgsql.sql (revision 21496) 546 626 +++ html/install/sql/create_table_pgsql.sql (working copy) 547 @@ -3 15,7 +315,8 @@627 @@ -304,7 +304,8 @@ 548 628 CREATE TABLE dtb_products_class ( 549 629 product_class_id int NOT NULL, … … 555 635 product_code text, 556 636 stock numeric, 557 @@ -3 57,14 +358,6 @@637 @@ -346,14 +347,6 @@ 558 638 PRIMARY KEY (classcategory_id) 559 639 ); … … 572 652 Index: html/install/sql/drop_table.sql 573 653 =================================================================== 574 --- html/install/sql/drop_table.sql (revision 214 30)654 --- html/install/sql/drop_table.sql (revision 21496) 575 655 +++ html/install/sql/drop_table.sql (working copy) 576 656 @@ -15,7 +15,6 @@ … … 584 664 Index: html/install/sql/insert_data.sql 585 665 =================================================================== 586 --- html/install/sql/insert_data.sql (revision 214 30)666 --- html/install/sql/insert_data.sql (revision 21496) 587 667 +++ html/install/sql/insert_data.sql (working copy) 588 668 @@ -236,8 +236,6 @@ … … 657 737 Index: test/createEcCubeData-v25.php 658 738 =================================================================== 659 --- test/createEcCubeData-v25.php (revision 214 30)739 --- test/createEcCubeData-v25.php (revision 21496) 660 740 +++ test/createEcCubeData-v25.php (working copy) 661 741 @@ -57,7 +57,7 @@ … … 706 786 + $sqlval['main_large_image'] = "nabe500.jpg"; 707 787 $sqlval['sub_comment1'] = "コメント"; 708 $sqlval['del_flg'] = (string) "0";788 $sqlval['del_flg'] = (string) '0'; 709 789 $sqlval['creator_id'] = 2; 710 790 @@ -373,35 +372,23 @@ … … 718 798 - $c1['class_combination_id'] = $this->objQuery->nextVal('dtb_class_combination_class_combination_id'); 719 799 - $c1['level'] = 1; 720 - $this->objQuery->insert( "dtb_class_combination", $c1);800 - $this->objQuery->insert('dtb_class_combination', $c1); 721 801 - 722 802 - $c2['classcategory_id'] = $classCategory_id2; … … 724 804 - $c2['parent_class_combination_id'] = $c1['class_combination_id']; 725 805 - $c2['level'] = 2; 726 - $this->objQuery->insert( "dtb_class_combination", $c2);806 - $this->objQuery->insert('dtb_class_combination', $c2); 727 807 - 728 808 - $sqlval['product_class_id'] = … … 737 817 + $sqlval['classcategory_id2'] = $classcategory_id2; 738 818 + $sqlval['product_code'] = 'CODE_' . $product_id . '_' . $classcategory_id1 . '_' . $classcategory_id2; 739 $this->objQuery->insert( "dtb_products_class", $sqlval);819 $this->objQuery->insert('dtb_products_class', $sqlval); 740 820 741 821 - $count++; … … 751 831 + $sqlval['product_code'] = 'CODE_' . $product_id; 752 832 $sqlval['del_flg'] = 1; 753 $this->objQuery->insert( "dtb_products_class", $sqlval);833 $this->objQuery->insert('dtb_products_class', $sqlval); 754 834 755 835 @@ -462,9 +449,9 @@ 756 , "43"757 , "42"758 , "41"836 ,'43' 837 ,'42' 838 ,'41' 759 839 - ,"43(27.0cm?27.5cm)" 760 840 - ,"42(26.5cm?27.0cm)" … … 765 845 ,"42(約27.5cm)" 766 846 ,"41(約26.5cm)" 767 , "W36"847 ,'W36'
Note: See TracChangeset
for help on using the changeset viewer.