source:
branches/version-2_12-dev/patches/no_tree.patch
@
21434
Revision 21434, 50.6 KB checked in by Seasoft, 12 years ago (diff) |
---|
-
data/class/helper/SC_Helper_DB.php
1437 1437 if (!SC_Utils_Ex::sfIsInt($product_id)) return false; 1438 1438 1439 1439 $objQuery =& SC_Query_Ex::getSingletonInstance(); 1440 $where = 'product_id = ? AND del_flg = 0 AND class _combination_id IS NOT NULL';1440 $where = 'product_id = ? AND del_flg = 0 AND classcategory_id1 != 0 AND classcategory_id2 != 0'; 1441 1441 $exists = $objQuery->exists('dtb_products_class', $where, array($product_id)); 1442 1442 1443 1443 return $exists; -
data/class/pages/admin/products/LC_Page_Admin_Products_Product.php
1048 1048 $objQuery->setOrder('product_class_id'); 1049 1049 $arrProductsClass = $objQuery->select($col, $table, $where, array($arrList["copy_product_id"])); 1050 1050 1051 // 複製元商品の規格組み合わせデータ登録1052 // 登録した組み合わせIDを取得1053 $arrRetCombinationId = $this->lfRegistClassCombination($arrProductsClass);1054 1055 1051 // 規格データ登録 1056 1052 $objQuery =& SC_Query_Ex::getSingletonInstance(); 1057 1053 foreach($arrProductsClass as $arrData) { 1058 $sqlval = array();1054 $sqlval = $arrData; 1059 1055 $sqlval['product_class_id'] = $objQuery->nextVal('dtb_products_class_product_class_id'); 1060 1056 $sqlval['product_id'] = $product_id; 1061 1057 $sqlval['create_date'] = 'CURRENT_TIMESTAMP'; 1062 $sqlval['class_combination_id'] = $arrRetCombinationId[$arrData['class_combination_id']];1063 $sqlval['product_type_id'] = $arrData['product_type_id'];1064 $sqlval['product_code'] = $arrData['product_code'];1065 $sqlval['stock'] = $arrData['stock'];1066 $sqlval['stock_unlimited'] = $arrData['stock_unlimited'];1067 $sqlval['sale_limit'] = $arrData['sale_limit'];1068 $sqlval['price01'] = $arrData['price01'];1069 $sqlval['price02'] = $arrData['price02'];1070 $sqlval['deliv_fee'] = $arrData['deliv_fee'];1071 $sqlval['point_rate'] = $arrData['point_rate'];1072 $sqlval['creator_id'] = $arrData['creator_id'];1073 1058 $sqlval['update_date'] = 'CURRENT_TIMESTAMP'; 1074 $sqlval['down_filename'] = $arrData['down_filename'];1075 $sqlval['down_realfilename'] = $arrData['down_realfilename'];1076 $sqlval['del_flg'] = $arrData['del_flg'];1077 1059 $objQuery->insert($table, $sqlval); 1078 1060 } 1079 1061 } … … 1266 1248 } 1267 1249 1268 1250 /** 1269 * 商品規格データを元に、規格組み合わせデータを複製登録する1270 *1271 * @param array $arrProductsClass 商品規格データ配列1272 * @return array 登録した規格組み合わせID配列1273 */1274 function lfRegistClassCombination($arrProductsClass) {1275 $arrRetCombinationId = array();1276 1277 // 規格組み合わせデータを取得1278 $arrClassCombination = $this->lfGetClassCombination($arrProductsClass);1279 1280 // 規格2を持っているかチェック1281 $has_class2 = $this->lfHasClass2($arrClassCombination);1282 1283 // 規格組み合わせデータを複製登録1284 if($has_class2 == true) {1285 // 規格2を持っている場合、規格1の組み合わせデータも取得1286 $arrClassCombinationParent = $this->lfGetClassCombination($arrClassCombination, true);1287 1288 // 親組み合わせデータを複製登録1289 $arrRetCombinationId = $this->lfInsertClassCombination($arrClassCombinationParent);1290 // 子組み合わせデータを複製登録1291 $arrRetCombinationId = $this->lfInsertClassCombination($arrClassCombination, $arrRetCombinationId);1292 } else {1293 // 規格1のみの場合、複製登録1294 $arrRetCombinationId = $this->lfInsertClassCombination($arrClassCombination);1295 }1296 1297 return $arrRetCombinationId;1298 }1299 1300 /**1301 * 規格2を持っている規格組み合わせデータであるか判定する1302 *1303 * @param array $arrClassCombination 規格組み合わせデータ配列1304 * @return boolean true: 規格2を持っている, false: 規格1のみ1305 */1306 function lfHasClass2($arrClassCombination) {1307 $has_class2 = false;1308 1309 foreach($arrClassCombination as $arrVal) {1310 if($arrVal['level'] == '2') {1311 $has_class2 = true;1312 break;1313 }1314 }1315 1316 return $has_class2;1317 }1318 1319 /**1320 * 規格組み合わせデータを取得する1321 *1322 * @param array $arrData 組み合わせIDを含むデータ配列1323 * @param boolean $is_parent 親規格IDから抽出するフラグ(省略時: false)1324 * @return array 規格組み合わせデータ配列1325 */1326 function lfGetClassCombination($arrData, $is_parent = false) {1327 $objQuery =& SC_Query_Ex::getSingletonInstance();1328 $key = 'class_combination_id';1329 if($is_parent == true) {1330 $key = 'parent_class_combination_id';1331 }1332 1333 $where = 'class_combination_id IN (';1334 $arrParam = array();1335 foreach($arrData as $arrVal) {1336 if(SC_Utils_Ex::isBlank($arrVal[$key]) == true) {1337 continue;1338 }1339 $where .= '?,';1340 $arrParam[] = $arrVal[$key];1341 }1342 $where = preg_replace('/,$/', ')', $where);1343 $arrClassCombination = $objQuery->select('*', 'dtb_class_combination', $where, $arrParam);1344 1345 return $arrClassCombination;1346 }1347 1348 /**1349 * 規格組み合わせデータを複製登録する1350 *1351 * @param array $arrClassCombination 複製元の規格組み合わせデータ配列1352 * @param array $arrParentCombinationId 登録する親組み合わせID配列 (省略可)1353 * @return array 登録した規格組み合わせID配列1354 */1355 function lfInsertClassCombination($arrClassCombination, $arrParentCombinationId = array()) {1356 $objQuery =& SC_Query_Ex::getSingletonInstance();1357 $arrRetCombinationId = array();1358 1359 // 親組み合わせIDの指定がある場合、指定された親組み合わせIDで複製登録1360 if(count($arrParentCombinationId) > 0) {1361 foreach($arrClassCombination as $key => $arrVal) {1362 $arrClassCombination[$key]['parent_class_combination_id'] = $arrParentCombinationId[$arrVal['parent_class_combination_id']];1363 }1364 }1365 1366 foreach($arrClassCombination as $arrVal) {1367 $sqlval = array();1368 $sqlval['class_combination_id'] = $objQuery->nextVal('dtb_class_combination_class_combination_id');1369 $sqlval['parent_class_combination_id'] = $arrVal['parent_class_combination_id'];1370 $sqlval['classcategory_id'] = $arrVal['classcategory_id'];1371 $sqlval['level'] = $arrVal['level'];1372 $objQuery->insert('dtb_class_combination', $sqlval);1373 1374 $arrRetCombinationId[$arrVal['class_combination_id']] = $sqlval['class_combination_id'];1375 }1376 1377 return $arrRetCombinationId;1378 }1379 1380 /**1381 1251 * リネームする際は、自動生成される画像名に一意となるように、Suffixを付ける 1382 1252 * 1383 1253 * @param string $to_key -
data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php
236 236 // デフォルト値として設定する値を取得しておく 237 237 $arrDefault = $this->getProductsClass($product_id); 238 238 239 $objQuery->delete('dtb_products_class', 'product_id = ? AND class_combination_id IS NOT NULL', array($product_id));239 $objQuery->delete('dtb_products_class', 'product_id = ? AND (classcategory_id1 <> 0 OR classcategory_id2 <> 0)', array($product_id)); 240 240 241 241 for ($i = 0; $i < $total; $i++) { 242 242 $del_flg = SC_Utils_Ex::isBlank($arrList['check'][$i]) ? 1 : 0; 243 243 $stock_unlimited = SC_Utils_Ex::isBlank($arrList['stock_unlimited'][$i]) ? 0 : $arrList['stock_unlimited'][$i]; 244 244 $price02 = SC_Utils_Ex::isBlank($arrList['price02'][$i]) ? 0 : $arrList['price02'][$i]; 245 245 // dtb_products_class 登録/更新用 246 $registerKeys = array('product_code', 'stock', 247 'price01', 'product_type_id', 248 'down_filename', 'down_realfilename'); 246 $registerKeys = array( 247 'classcategory_id1', 'classcategory_id2', 248 'product_code', 'stock', 'price01', 'product_type_id', 249 'down_filename', 'down_realfilename', 250 ); 249 251 250 252 $arrPC = array(); 251 253 foreach ($registerKeys as $key) { … … 263 265 $arrPC['update_date'] = 'CURRENT_TIMESTAMP'; 264 266 $arrPC['del_flg'] = $del_flg; 265 267 266 $class_combination_id = $arrExists[$arrList['product_class_id'][$i]]['class_combination_id'];267 $existsCombi = $objQuery->getRow('*', 'dtb_class_combination',268 'class_combination_id = ?',269 array($class_combination_id));270 271 $objQuery->delete('dtb_class_combination',272 'class_combination_id IN (?, ?)',273 array($existsCombi['class_combination_id'],274 $existsCombi['parent_class_combination_id']));275 276 // 規格組み合わせを登録277 $arrComb1['class_combination_id'] = $objQuery->nextVal('dtb_class_combination_class_combination_id');278 $arrComb1['classcategory_id'] = $arrList['classcategory_id1'][$i];279 $arrComb1['level'] = 1;280 $objQuery->insert('dtb_class_combination', $arrComb1);281 282 // 規格2も登録する場合283 if (!SC_Utils_Ex::isBlank($arrList['classcategory_id2'][$i])) {284 $arrComb2['class_combination_id'] = $objQuery->nextVal('dtb_class_combination_class_combination_id');285 $arrComb2['classcategory_id'] = $arrList['classcategory_id2'][$i];286 $arrComb2['parent_class_combination_id'] = $arrComb1['class_combination_id'];287 $arrComb2['level'] = 2;288 $objQuery->insert('dtb_class_combination', $arrComb2);289 290 $arrPC['class_combination_id'] = $arrComb2['class_combination_id'];291 } else {292 $arrPC['class_combination_id'] = $arrComb1['class_combination_id'];293 }294 295 268 $arrPC['create_date'] = 'CURRENT_TIMESTAMP'; 296 269 // 更新の場合は, product_class_id を使い回す 297 270 if (!SC_Utils_Ex::isBlank($arrList['product_class_id'][$i])) { … … 312 285 $arrBlank['del_flg'] = 1; 313 286 $arrBlank['update_date'] = 'CURRENT_TIMESTAMP'; 314 287 $objQuery->update("dtb_products_class", $arrBlank, 315 "product_id = ? AND class _combination_id IS NULL",288 "product_id = ? AND classcategory_id1 = 0 AND classcategory_id2 = 0", 316 289 array($product_id)); 317 290 318 291 // 件数カウントバッチ実行 … … 478 451 function doPreEdit(&$objFormParam) { 479 452 $product_id = $objFormParam->getValue('product_id'); 480 453 $objProduct = new SC_Product_Ex(); 481 $existsProductsClass = $objProduct->getProductsClassFullByProductId($product_id , true);454 $existsProductsClass = $objProduct->getProductsClassFullByProductId($product_id); 482 455 483 456 // 規格のデフォルト値(すべての組み合わせ)を取得し, フォームに反映 484 457 $class_id1 = $existsProductsClass[0]['class_id1']; … … 556 529 $objQuery =& SC_Query_Ex::getSingletonInstance(); 557 530 558 531 $objQuery->begin(); 559 $arrClassCombi = $objQuery->getCol('class_combination_id',560 'dtb_products_class',561 'product_id = ?', array($product_id));562 532 563 foreach ($arrClassCombi as $class_combination_id) { 564 if (SC_Utils_Ex::isBlank($class_combination_id)) { 565 continue; 566 } 567 $existsCombi = $objQuery->getRow('*', 'dtb_class_combination', 568 'class_combination_id = ?', 569 array($class_combination_id)); 533 // 商品規格なしデータの復元 534 $where = 'product_id = ? AND classcategory_id1 = 0 AND classcategory_id2 = 0'; 535 $objQuery->update("dtb_products_class", array('del_flg' => 0), $where, array($product_id)); 570 536 571 $objQuery->delete('dtb_class_combination', 572 'class_combination_id IN (?, ?)', 573 array($existsCombi['class_combination_id'], 574 $existsCombi['parent_class_combination_id'])); 575 } 576 $objQuery->update("dtb_products_class", array('del_flg' => 0), 577 "product_id = ? AND class_combination_id IS NULL", 578 array($product_id)); 579 $objQuery->delete("dtb_products_class", 580 "product_id = ? AND class_combination_id IS NOT NULL", 581 array($product_id)); 537 // 商品規格データの削除 538 $where = 'product_id = ? AND (classcategory_id1 <> 0 OR classcategory_id2 <> 0)'; 539 $objQuery->delete("dtb_products_class", $where, array($product_id)); 540 582 541 $objQuery->commit(); 583 542 584 543 // 在庫無し商品の非表示対応 … … 779 738 function getProductsClass($product_id) { 780 739 $objQuery =& SC_Query_Ex::getSingletonInstance(); 781 740 $col = "product_code, price01, price02, stock, stock_unlimited, sale_limit, deliv_fee, point_rate"; 782 return $objQuery->getRow($col, "dtb_products_class", "product_id = ? AND class_combination_id IS NULL", array($product_id)); 741 $where = 'product_id = ? AND classcategory_id1 = 0 AND classcategory_id2 = 0'; 742 return $objQuery->getRow($col, "dtb_products_class", $where, array($product_id)); 783 743 } 784 744 785 745 /** -
data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php
613 613 */ 614 614 function lfCheckErrorDetail($item, $arrErr) { 615 615 // 規格IDの存在チェック 616 // FIXME 規格分類ID自体のが有効かを主眼においたチェックをすべきと感じる。 616 617 if(!$this->lfIsDbRecord('dtb_products_class', 'product_class_id', $item)) { 617 618 $arrErr['product_class_id'] = "※ 指定の商品規格IDは、登録されていません。"; 618 619 } … … 628 629 } 629 630 } 630 631 } 631 // 規格組合せIDの存在チェック632 // if(!$this->lfIsDbRecord('dtb_class_combination', 'class_combination_id', $item)) {633 // SC_Utils::sfIsRecord が del_flg が無いと使えない為、個別処理634 if(array_search('class_combination_id', $this->arrFormKeyList) !== FALSE635 and $item['class_combination_id'] != "" ) {636 $objQuery =& SC_Query_Ex::getSingletonInstance();637 $ret = $objQuery->get('class_combination_id', 'dtb_class_combination', 'class_combination_id = ?', array($item['class_combination_id']));638 if($ret == "") {639 $arrErr['class_combination_id'] = "※ 指定の規格組合せIDは、登録されていません。";640 }641 }642 632 // 表示ステータスの存在チェック 643 633 if(!$this->lfIsArrayRecord($this->arrDISP, 'status', $item)) { 644 634 $arrErr['status'] = "※ 指定の表示ステータスは、登録されていません。"; -
data/class/SC_Product.php
258 258 : ''; 259 259 260 260 // 規格1が設定されている 261 $this->classCat1_find[$productId] = (!SC_Utils_Ex::isBlank($arrProductClass[0]['classcategory_id1']));261 $this->classCat1_find[$productId] = $arrProductClass[0]['classcategory_id1'] > 0; // 要変更ただし、他にも改修が必要となる 262 262 // 規格2が設定されている 263 $this->classCat2_find[$productId] = (!SC_Utils_Ex::isBlank($arrProductClass[0]['classcategory_id2']));263 $this->classCat2_find[$productId] = $arrProductClass[0]['classcategory_id2'] > 0; // 要変更ただし、他にも改修が必要となる 264 264 265 265 $this->stock_find[$productId] = false; 266 266 $classCategories = array(); … … 315 315 $classCats2['product_type'] = $productsClass['product_type_id']; 316 316 317 317 // #929(GC8 規格のプルダウン順序表示不具合)対応のため、2次キーは「#」を前置 318 if ( SC_Utils_Ex::isBlank($productsClass1)) {318 if (!$this->classCat1_find[$productId]) { 319 319 $productsClass1 = '__unselected2'; 320 320 } 321 321 $classCategories[$productsClass1]['#'] = array( … … 355 355 T1.product_type_id, 356 356 T1.down_filename, 357 357 T1.down_realfilename, 358 T2.class_combination_id, 359 T2.parent_class_combination_id, 360 T2.classcategory_id, 361 T2.level, 362 T3.name AS classcategory_name, 363 T3.rank, 364 T4.name AS class_name, 365 T4.class_id 358 T3.name AS classcategory_name1, 359 T3.rank AS rank1, 360 T4.name AS class_name1, 361 T4.class_id AS class_id1, 362 T1.classcategory_id1, 363 T1.classcategory_id2, 364 dtb_classcategory2.name AS classcategory_name2, 365 dtb_classcategory2.rank AS rank2, 366 dtb_class2.name AS class_name2, 367 dtb_class2.class_id AS class_id2 366 368 __EOS__; 367 369 $table = <<< __EOS__ 368 370 dtb_products_class T1 369 LEFT JOIN dtb_class_combination T2370 ON T1.class_combination_id = T2.class_combination_id371 371 LEFT JOIN dtb_classcategory T3 372 ON T 2.classcategory_id= T3.classcategory_id372 ON T1.classcategory_id1 = T3.classcategory_id 373 373 LEFT JOIN dtb_class T4 374 374 ON T3.class_id = T4.class_id 375 LEFT JOIN dtb_classcategory dtb_classcategory2 376 ON T1.classcategory_id2 = dtb_classcategory2.classcategory_id 377 LEFT JOIN dtb_class dtb_class2 378 ON dtb_classcategory2.class_id = dtb_class2.class_id 375 379 __EOS__; 376 380 377 381 $objQuery->setOrder('T3.rank DESC'); // XXX 378 382 $arrRet = $objQuery->select($col, $table, "", $params); 379 $levels = array();380 $parents = array();381 foreach ($arrRet as $rows) {382 $levels[] = $rows['level'];383 $parents[] = $rows['parent_class_combination_id'];384 }385 $level = max($levels);386 $parentsClass = array();387 // 階層分の親を取得388 for ($i = 0; $i < $level -1; $i++) {389 $objQuery =& SC_Query_Ex::getSingletonInstance();390 $objQuery->setWhere('T1.class_combination_id IN (' . implode(', ', array_pad(array(), count($parents), '?')) . ')');391 383 392 $col = <<< __EOS__ 393 T1.class_combination_id, 394 T1.classcategory_id, 395 T1.parent_class_combination_id, 396 T1.level, 397 T2.name AS classcategory_name, 398 T2.rank, 399 T3.name AS class_name, 400 T3.class_id 401 __EOS__; 402 $table = <<< __EOS__ 403 dtb_class_combination T1 404 LEFT JOIN dtb_classcategory T2 405 ON T1.classcategory_id = T2.classcategory_id 406 LEFT JOIN dtb_class T3 407 ON T2.class_id = T3.class_id 408 __EOS__; 409 410 $objQuery->setOrder('T2.rank DESC'); // XXX 411 $arrParents = $objQuery->select($col, $table, "", $parents); 412 413 foreach ($arrParents as $rows) { 414 $parents[] = $rows['parent_class_combination_id']; 415 416 foreach ($arrRet as $child) { 417 if ($child['parent_class_combination_id'] 418 == $rows['class_combination_id']) { 419 $rows['product_id'] = $child['product_id']; 420 } 421 } 422 $tmpParents[] = $rows; 423 } 424 $parentsClass = array_merge($parentsClass, $tmpParents); 425 } 426 427 // 末端から枝を作成 428 $tmpClass = array_merge($arrRet, $parentsClass); 429 430 foreach ($tmpClass as $val) { 431 $val['class_id' . $val['level']] = $val['class_id']; 432 $val['class_name' . $val['level']] = $val['class_name']; 433 $val['classcategory_name' . $val['level']] = $val['classcategory_name']; 434 $val['classcategory_id' . $val['level']] = $val['classcategory_id']; 435 $arrProductsClass[] = $val; 436 } 437 return $arrProductsClass; 384 return $arrRet; 438 385 } 439 386 440 387 /** … … 788 735 ( 789 736 SELECT dtb_products.*, 790 737 dtb_products_class.product_class_id, 791 dtb_products_class.class_combination_id,738 'dummy' AS class_combination_id, 792 739 dtb_products_class.product_type_id, 793 740 dtb_products_class.product_code, 794 741 dtb_products_class.stock, … … 800 747 dtb_products_class.point_rate, 801 748 dtb_products_class.down_filename, 802 749 dtb_products_class.down_realfilename, 803 dtb_class_combination.parent_class_combination_id, 804 dtb_class_combination.classcategory_id, 805 dtb_class_combination.level as classlevel, 806 Tpcm.classcategory_id as parent_classcategory_id, 807 Tpcm.level as parent_classlevel, 750 'dummy' AS parent_class_combination_id, -- 削除 751 dtb_products_class.classcategory_id1 AS classcategory_id, -- 削除 752 dtb_products_class.classcategory_id1, 753 'dummy' as classlevel, -- 削除 754 dtb_products_class.classcategory_id2 AS parent_classcategory_id, -- 削除 755 dtb_products_class.classcategory_id2, 756 'dummy' as parent_classlevel, -- 削除 808 757 Tcc1.class_id as class_id, 809 758 Tcc1.name as classcategory_name, 810 759 Tcc2.class_id as parent_class_id, … … 812 761 FROM dtb_products 813 762 LEFT JOIN dtb_products_class 814 763 ON dtb_products.product_id = dtb_products_class.product_id 815 LEFT JOIN dtb_class_combination816 ON dtb_products_class.class_combination_id = dtb_class_combination.class_combination_id817 LEFT JOIN dtb_class_combination as Tpcm818 ON dtb_class_combination.parent_class_combination_id = Tpcm.class_combination_id819 764 LEFT JOIN dtb_classcategory as Tcc1 820 ON dtb_ class_combination.classcategory_id= Tcc1.classcategory_id765 ON dtb_products_class.classcategory_id1 = Tcc1.classcategory_id 821 766 LEFT JOIN dtb_classcategory as Tcc2 822 ON Tpcm.classcategory_id= Tcc2.classcategory_id767 ON dtb_products_class.classcategory_id2 = Tcc2.classcategory_id 823 768 $where_clause 824 769 ) as prdcls 825 770 __EOS__; -
html/install/index.php
1053 1053 array("dtb_payment", "payment_id"), 1054 1054 array("dtb_products_class", "product_class_id"), 1055 1055 array("dtb_products", "product_id"), 1056 array("dtb_class_combination", "class_combination_id"),1057 1056 array("dtb_review", "review_id"), 1058 1057 array("dtb_send_history", "send_id"), 1059 1058 array("dtb_mailmaga_template", "template_id")); -
html/install/sql/create_table_mysql.sql
315 315 CREATE TABLE dtb_products_class ( 316 316 product_class_id int NOT NULL, 317 317 product_id int NOT NULL, 318 class_combination_id int, 318 classcategory_id1 int NOT NULL DEFAULT 0, 319 classcategory_id2 int NOT NULL DEFAULT 0, 319 320 product_type_id int NOT NULL DEFAULT 0, 320 321 product_code text, 321 322 stock numeric, … … 357 358 PRIMARY KEY (classcategory_id) 358 359 ) ENGINE=InnoDB; 359 360 360 CREATE TABLE dtb_class_combination (361 class_combination_id int NOT NULL,362 parent_class_combination_id int,363 classcategory_id int NOT NULL,364 level int,365 PRIMARY KEY(class_combination_id)366 ) ENGINE=InnoDB;367 368 361 CREATE TABLE dtb_category ( 369 362 category_id int NOT NULL, 370 363 category_name text, -
html/install/sql/create_table_pgsql.sql
315 315 CREATE TABLE dtb_products_class ( 316 316 product_class_id int NOT NULL, 317 317 product_id int NOT NULL, 318 class_combination_id int, 318 classcategory_id1 int NOT NULL DEFAULT 0, 319 classcategory_id2 int NOT NULL DEFAULT 0, 319 320 product_type_id int NOT NULL DEFAULT 0, 320 321 product_code text, 321 322 stock numeric, … … 357 358 PRIMARY KEY (classcategory_id) 358 359 ); 359 360 360 CREATE TABLE dtb_class_combination (361 class_combination_id int NOT NULL,362 parent_class_combination_id int,363 classcategory_id int NOT NULL,364 level int,365 PRIMARY KEY (class_combination_id)366 );367 368 361 CREATE TABLE dtb_category ( 369 362 category_id int NOT NULL, 370 363 category_name text, -
html/install/sql/drop_table.sql
15 15 DROP TABLE dtb_product_status; 16 16 DROP TABLE dtb_class; 17 17 DROP TABLE dtb_classcategory; 18 DROP TABLE dtb_class_combination;19 18 DROP TABLE dtb_category; 20 19 DROP TABLE dtb_recommend_products; 21 20 DROP TABLE dtb_review; -
html/install/sql/insert_data.sql
236 236 237 237 INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (1, 1, 'product_id', '商品ID', 1, 3, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK'); 238 238 INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (2, 1, 'product_class_id', '商品規格ID', 2, 3, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK'); 239 INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (3, 1, 'parent_class_combination_id', '親規格組合わせID', 3, 2, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK');240 INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (4, 1, 'class_combination_id', '規格組合わせID', 4, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK');241 239 INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (5, 1, 'parent_classcategory_id', '親規格分類ID', 5, 2, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK'); 242 240 INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (6, 1, 'classcategory_id', '規格分類ID', 6, 2, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK'); 243 241 INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (7, 1, 'parent_classcategory_name', '親規格分類名', 7, 2, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVa', 'STEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK'); … … 395 393 INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (198, 5, 'level', '階層', NULL, 2, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK'); 396 394 INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (199, 5, 'rank', '表示ランク', NULL, 2, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK'); 397 395 INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (200, 5, 'del_flg', '削除フラグ', NULL, 1, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK'); 396 UPDATE dtb_csv SET no = no - 2 WHERE no > 2; 397 UPDATE dtb_csv SET rank = rank - 2 WHERE csv_id = 1 AND rank > 2; 398 398 399 399 INSERT INTO dtb_deliv (deliv_id, product_type_id, name, service_name, confirm_url, rank, status, del_flg, creator_id, create_date, update_date) VALUES (1, 1, 'サンプル業者', 'サンプル業者', NULL, 2, 1, 0, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); 400 400 INSERT INTO dtb_deliv (deliv_id, product_type_id, name, service_name, confirm_url, rank, status, del_flg, creator_id, create_date, update_date) VALUES (2, 2, '配送無し(ダウンロード商品用)', 'なし', NULL, 1, 1, 0, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); … … 703 703 INSERT INTO dtb_products (product_id, name, maker_id, status, comment1, comment2, comment3, comment4, comment5, comment6, note, main_list_comment, main_list_image, main_comment, main_image, main_large_image, sub_title1, sub_comment1, sub_image1, sub_large_image1, sub_title2, sub_comment2, sub_image2, sub_large_image2, sub_title3, sub_comment3, sub_image3, sub_large_image3, sub_title4, sub_comment4, sub_image4, sub_large_image4, sub_title5, sub_comment5, sub_image5, sub_large_image5, sub_title6, sub_comment6, sub_image6, sub_large_image6, del_flg, creator_id, create_date, update_date, deliv_date_id) VALUES (2, 'おなべ', NULL, 1, NULL, NULL, '鍋,なべ,ナベ', NULL, NULL, NULL, NULL, '一人用からあります。', 'nabe130.jpg', 'たまには鍋でもどうでしょう。', 'nabe260.jpg', 'nabe500.jpg', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 3); 704 704 INSERT INTO dtb_products (product_id, name, maker_id, status, comment1, comment2, comment3, comment4, comment5, comment6, note, main_list_comment, main_list_image, main_comment, main_image, main_large_image, sub_title1, sub_comment1, sub_image1, sub_large_image1, sub_title2, sub_comment2, sub_image2, sub_large_image2, sub_title3, sub_comment3, sub_image3, sub_large_image3, sub_title4, sub_comment4, sub_image4, sub_large_image4, sub_title5, sub_comment5, sub_image5, sub_large_image5, sub_title6, sub_comment6, sub_image6, sub_large_image6, del_flg, creator_id, create_date, update_date, deliv_date_id) VALUES (3, 'おなべレシピ', NULL, 1, NULL, NULL, '鍋,なべ,ナベ,レシピ,作り方', NULL, NULL, NULL, NULL, 'あの、秘伝のお鍋レシピです。', 'recipe130.jpg', '<b>この商品はダウンロード商品です</b><br />自分でチャレンジしてみたい方に。', 'recipe260.jpg', 'recipe500.jpg', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 1); 705 705 706 INSERT INTO dtb_products_class (product_class_id, product_id, class _combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(0, 1, NULL, 'ice-01', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 1, 1, NULL, NULL);707 INSERT INTO dtb_products_class (product_class_id, product_id, class _combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(1, 1, 10, 'ice-01', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);708 INSERT INTO dtb_products_class (product_class_id, product_id, class _combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(2, 1, 11, 'ice-02', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);709 INSERT INTO dtb_products_class (product_class_id, product_id, class _combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(3, 1, 12, 'ice-03', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);710 INSERT INTO dtb_products_class (product_class_id, product_id, class _combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(4, 1, 13, 'ice-04', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);711 INSERT INTO dtb_products_class (product_class_id, product_id, class _combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(5, 1, 14, 'ice-05', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);712 INSERT INTO dtb_products_class (product_class_id, product_id, class _combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(6, 1, 15, 'ice-06', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);713 INSERT INTO dtb_products_class (product_class_id, product_id, class _combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(7, 1, 16, 'ice-07', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);714 INSERT INTO dtb_products_class (product_class_id, product_id, class _combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(8, 1, 17, 'ice-08', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);715 INSERT INTO dtb_products_class (product_class_id, product_id, class _combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(9, 1, 18, 'ice-09', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);716 INSERT INTO dtb_products_class (product_class_id, product_id, class _combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(10, 2, NULL, 'nabe-01', 100, 0, 5, 1700, 1650, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);717 INSERT INTO dtb_products_class (product_class_id, product_id, class _combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(11, 3, NULL, 'recipe-01', NULL, 1, NULL, NULL, 100, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 2, 'おなべレシピ.pdf', 'recipe_onabe.pdf');706 INSERT INTO dtb_products_class (product_class_id, product_id, classcategory_id1, classcategory_id2, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(0, 1, 0, 0, 'ice-01', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 1, 1, NULL, NULL); 707 INSERT INTO dtb_products_class (product_class_id, product_id, classcategory_id1, classcategory_id2, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(1, 1, 3, 6, 'ice-01', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL); 708 INSERT INTO dtb_products_class (product_class_id, product_id, classcategory_id1, classcategory_id2, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(2, 1, 3, 5, 'ice-02', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL); 709 INSERT INTO dtb_products_class (product_class_id, product_id, classcategory_id1, classcategory_id2, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(3, 1, 3, 4, 'ice-03', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL); 710 INSERT INTO dtb_products_class (product_class_id, product_id, classcategory_id1, classcategory_id2, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(4, 1, 2, 6, 'ice-04', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL); 711 INSERT INTO dtb_products_class (product_class_id, product_id, classcategory_id1, classcategory_id2, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(5, 1, 2, 5, 'ice-05', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL); 712 INSERT INTO dtb_products_class (product_class_id, product_id, classcategory_id1, classcategory_id2, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(6, 1, 2, 4, 'ice-06', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL); 713 INSERT INTO dtb_products_class (product_class_id, product_id, classcategory_id1, classcategory_id2, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(7, 1, 1, 6, 'ice-07', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL); 714 INSERT INTO dtb_products_class (product_class_id, product_id, classcategory_id1, classcategory_id2, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(8, 1, 1, 5, 'ice-08', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL); 715 INSERT INTO dtb_products_class (product_class_id, product_id, classcategory_id1, classcategory_id2, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(9, 1, 1, 4, 'ice-09', NULL, 1, NULL, 1000, 933, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL); 716 INSERT INTO dtb_products_class (product_class_id, product_id, classcategory_id1, classcategory_id2, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(10, 2, 0, 0, 'nabe-01', 100, 0, 5, 1700, 1650, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL); 717 INSERT INTO dtb_products_class (product_class_id, product_id, classcategory_id1, classcategory_id2, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, creator_id, create_date, update_date, del_flg, product_type_id, down_filename, down_realfilename) VALUES(11, 3, 0, 0, 'recipe-01', NULL, 1, NULL, NULL, 100, NULL, 10, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 2, 'おなべレシピ.pdf', 'recipe_onabe.pdf'); 718 718 719 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(1, NULL, 3, 1);720 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(2, NULL, 3, 1);721 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(3, NULL, 3, 1);722 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(4, NULL, 2, 1);723 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(5, NULL, 2, 1);724 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(6, NULL, 2, 1);725 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(7, NULL, 1, 1);726 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(8, NULL, 1, 1);727 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(9, NULL, 1, 1);728 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(10, 1, 6, 2);729 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(11, 2, 5, 2);730 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(12, 3, 4, 2);731 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(13, 4, 6, 2);732 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(14, 5, 5, 2);733 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(15, 6, 4, 2);734 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(16, 7, 6, 2);735 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(17, 8, 5, 2);736 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(18, 9, 4, 2);737 738 719 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, 0); 739 720 INSERT INTO dtb_product_status (product_status_id, product_id, creator_id, create_date, update_date, del_flg) VALUES (4, 3, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0); 740 721 INSERT INTO dtb_product_status (product_status_id, product_id, creator_id, create_date, update_date, del_flg) VALUES (5, 3, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0); -
test/createEcCubeData-v25.php
57 57 58 58 $objData = new CreateEcCubeData(); 59 59 $start = microtime_float(); 60 //$objData->objQuery->begin();60 $objData->objQuery->begin(); 61 61 62 62 // カテゴリ生成 63 63 $objData->createCategories(); … … 74 74 $objDb->sfCountCategory(NULL, true); 75 75 76 76 //$objData->objQuery->rollback(); 77 //$objData->objQuery->commit();77 $objData->objQuery->commit(); 78 78 $end = microtime_float(); 79 79 print("データの生成が完了しました!\n"); 80 80 printf("所要時間 %f 秒\n", $end - $start); … … 107 107 var $arrClassCategory_id2 = array(); 108 108 109 109 /** 削除するか */ 110 var $delete = false;110 var $delete = true; 111 111 112 112 /** 113 113 * コンストラクタ. … … 242 242 print("商品と規格の関連づけを行います...\n"); 243 243 244 244 if ($this->delete) { 245 $this->objQuery->delete('dtb_class_combination');246 245 $this->objQuery->delete('dtb_products_class'); 247 246 } 248 247 … … 271 270 $sqlval['status'] = 1; 272 271 $sqlval['comment3'] = "コメント"; 273 272 $sqlval['main_list_comment'] = "コメント"; 274 $sqlval['main_list_image'] = " 08311201_44f65122ee5fe.jpg";273 $sqlval['main_list_image'] = "nabe130.jpg"; 275 274 $sqlval['main_comment'] = "コメント"; 276 $sqlval['main_image'] = " 08311202_44f6515906a41.jpg";277 $sqlval['main_large_image'] = " 08311203_44f651959bcb5.jpg";275 $sqlval['main_image'] = "nabe260.jpg"; 276 $sqlval['main_large_image'] = "nabe500.jpg"; 278 277 $sqlval['sub_comment1'] = "コメント"; 279 278 $sqlval['del_flg'] = (string) "0"; 280 279 $sqlval['creator_id'] = 2; … … 373 372 $sqlval['update_date'] = 'CURRENT_TIMESTAMP'; 374 373 $sqlval['del_flg'] = 0; 375 374 376 $count = 0; 377 foreach ($this->arrClassCategory_id1 as $classCategory_id1) { 378 foreach ($this->arrClassCategory_id2 as $classCategory_id2) { 379 $c1['classcategory_id'] = $classCategory_id1; 380 $c1['class_combination_id'] = $this->objQuery->nextVal('dtb_class_combination_class_combination_id'); 381 $c1['level'] = 1; 382 $this->objQuery->insert("dtb_class_combination", $c1); 383 384 $c2['classcategory_id'] = $classCategory_id2; 385 $c2['class_combination_id'] = $this->objQuery->nextVal('dtb_class_combination_class_combination_id'); 386 $c2['parent_class_combination_id'] = $c1['class_combination_id']; 387 $c2['level'] = 2; 388 $this->objQuery->insert("dtb_class_combination", $c2); 389 390 $sqlval['product_class_id'] = 391 $this->objQuery->nextVal('dtb_products_class_product_class_id'); 392 $sqlval['product_code'] = sprintf("商品コード%d", $count); 393 394 $sqlval['class_combination_id'] = $c2['class_combination_id']; 375 foreach ($this->arrClassCategory_id1 as $classcategory_id1) { 376 foreach ($this->arrClassCategory_id2 as $classcategory_id2) { 377 $sqlval['product_class_id'] = $this->objQuery->nextVal('dtb_products_class_product_class_id'); 378 $sqlval['classcategory_id1'] = $classcategory_id1; 379 $sqlval['classcategory_id2'] = $classcategory_id2; 380 $sqlval['product_code'] = 'CODE_' . $product_id . '_' . $classcategory_id1 . '_' . $classcategory_id2; 395 381 $this->objQuery->insert("dtb_products_class", $sqlval); 396 382 397 $count++;398 383 print("#"); 399 384 } 400 385 } 401 386 402 387 // 規格無し用 403 388 $sqlval['product_class_id'] = $this->objQuery->nextVal('dtb_products_class_product_class_id'); 404 $sqlval['class_combination_id'] = null; 389 $sqlval['classcategory_id1'] = 0; 390 $sqlval['classcategory_id2'] = 0; 391 $sqlval['product_code'] = 'CODE_' . $product_id; 405 392 $sqlval['del_flg'] = 1; 406 393 $this->objQuery->insert("dtb_products_class", $sqlval); 407 394 … … 462 449 ,"43" 463 450 ,"42" 464 451 ,"41" 465 ,"43(27.0cm ?27.5cm)"466 ,"42(26.5cm ?27.0cm)"467 ,"37(ladies 23.5 ?24cm)"452 ,"43(27.0cm~27.5cm)" 453 ,"42(26.5cm~27.0cm)" 454 ,"37(ladies 23.5~24cm)" 468 455 ,"42(約27.5cm)" 469 456 ,"41(約26.5cm)" 470 457 ,"W36"
Note: See TracBrowser
for help on using the repository browser.