source: branches/version-2_12-dev/patches/no_tree.patch @ 21434

Revision 21434, 50.6 KB checked in by Seasoft, 12 years ago (diff)

木構造を使用しないカスタマイズ (patch 2版)

  • data/class/helper/SC_Helper_DB.php

     
    14371437        if (!SC_Utils_Ex::sfIsInt($product_id)) return false; 
    14381438 
    14391439        $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'; 
    14411441        $exists = $objQuery->exists('dtb_products_class', $where, array($product_id)); 
    14421442 
    14431443        return $exists; 
  • data/class/pages/admin/products/LC_Page_Admin_Products_Product.php

     
    10481048                    $objQuery->setOrder('product_class_id'); 
    10491049                    $arrProductsClass = $objQuery->select($col, $table, $where, array($arrList["copy_product_id"])); 
    10501050 
    1051                     // 複製元商品の規格組み合わせデータ登録 
    1052                     // 登録した組み合わせIDを取得 
    1053                     $arrRetCombinationId = $this->lfRegistClassCombination($arrProductsClass); 
    1054  
    10551051                    // 規格データ登録 
    10561052                    $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    10571053                    foreach($arrProductsClass as $arrData) { 
    1058                         $sqlval = array(); 
     1054                        $sqlval = $arrData; 
    10591055                        $sqlval['product_class_id'] = $objQuery->nextVal('dtb_products_class_product_class_id'); 
    10601056                        $sqlval['product_id'] = $product_id; 
    10611057                        $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']; 
    10731058                        $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']; 
    10771059                        $objQuery->insert($table, $sqlval); 
    10781060                    } 
    10791061                } 
     
    12661248    } 
    12671249 
    12681250    /** 
    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     /** 
    13811251     * リネームする際は、自動生成される画像名に一意となるように、Suffixを付ける 
    13821252     *  
    13831253     * @param string $to_key 
  • data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php

     
    236236        // デフォルト値として設定する値を取得しておく 
    237237        $arrDefault = $this->getProductsClass($product_id); 
    238238 
    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)); 
    240240 
    241241        for ($i = 0; $i < $total; $i++) { 
    242242            $del_flg = SC_Utils_Ex::isBlank($arrList['check'][$i]) ? 1 : 0; 
    243243            $stock_unlimited = SC_Utils_Ex::isBlank($arrList['stock_unlimited'][$i]) ? 0 : $arrList['stock_unlimited'][$i]; 
    244244            $price02 = SC_Utils_Ex::isBlank($arrList['price02'][$i]) ? 0 : $arrList['price02'][$i]; 
    245245            // 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            ); 
    249251 
    250252            $arrPC = array(); 
    251253            foreach ($registerKeys as $key) { 
     
    263265            $arrPC['update_date'] = 'CURRENT_TIMESTAMP'; 
    264266            $arrPC['del_flg'] = $del_flg; 
    265267 
    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  
    295268            $arrPC['create_date'] = 'CURRENT_TIMESTAMP'; 
    296269            // 更新の場合は, product_class_id を使い回す 
    297270            if (!SC_Utils_Ex::isBlank($arrList['product_class_id'][$i])) { 
     
    312285        $arrBlank['del_flg'] = 1; 
    313286        $arrBlank['update_date'] = 'CURRENT_TIMESTAMP'; 
    314287        $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", 
    316289                          array($product_id)); 
    317290 
    318291        // 件数カウントバッチ実行 
     
    478451    function doPreEdit(&$objFormParam) { 
    479452        $product_id = $objFormParam->getValue('product_id'); 
    480453        $objProduct = new SC_Product_Ex(); 
    481         $existsProductsClass = $objProduct->getProductsClassFullByProductId($product_id, true); 
     454        $existsProductsClass = $objProduct->getProductsClassFullByProductId($product_id); 
    482455 
    483456        // 規格のデフォルト値(すべての組み合わせ)を取得し, フォームに反映 
    484457        $class_id1 = $existsProductsClass[0]['class_id1']; 
     
    556529        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    557530 
    558531        $objQuery->begin(); 
    559         $arrClassCombi = $objQuery->getCol('class_combination_id', 
    560                                            'dtb_products_class', 
    561                                            'product_id = ?', array($product_id)); 
    562532 
    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)); 
    570536 
    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 
    582541        $objQuery->commit(); 
    583542 
    584543        // 在庫無し商品の非表示対応 
     
    779738    function getProductsClass($product_id) { 
    780739        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    781740        $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)); 
    783743    } 
    784744 
    785745    /** 
  • data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php

     
    613613     */ 
    614614    function lfCheckErrorDetail($item, $arrErr) { 
    615615        // 規格IDの存在チェック 
     616        // FIXME 規格分類ID自体のが有効かを主眼においたチェックをすべきと感じる。 
    616617        if(!$this->lfIsDbRecord('dtb_products_class', 'product_class_id', $item)) { 
    617618            $arrErr['product_class_id'] = "※ 指定の商品規格IDは、登録されていません。"; 
    618619        } 
     
    628629                } 
    629630            } 
    630631        } 
    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) !== FALSE 
    635                 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         } 
    642632        // 表示ステータスの存在チェック 
    643633        if(!$this->lfIsArrayRecord($this->arrDISP, 'status', $item)) { 
    644634            $arrErr['status'] = "※ 指定の表示ステータスは、登録されていません。"; 
  • data/class/SC_Product.php

     
    258258                : ''; 
    259259 
    260260            // 規格1が設定されている 
    261             $this->classCat1_find[$productId] = (!SC_Utils_Ex::isBlank($arrProductClass[0]['classcategory_id1'])); 
     261            $this->classCat1_find[$productId] = $arrProductClass[0]['classcategory_id1'] > 0; // 要変更ただし、他にも改修が必要となる 
    262262            // 規格2が設定されている 
    263             $this->classCat2_find[$productId] = (!SC_Utils_Ex::isBlank($arrProductClass[0]['classcategory_id2'])); 
     263            $this->classCat2_find[$productId] = $arrProductClass[0]['classcategory_id2'] > 0; // 要変更ただし、他にも改修が必要となる 
    264264 
    265265            $this->stock_find[$productId] = false; 
    266266            $classCategories = array(); 
     
    315315                $classCats2['product_type'] = $productsClass['product_type_id']; 
    316316 
    317317                // #929(GC8 規格のプルダウン順序表示不具合)対応のため、2次キーは「#」を前置 
    318                 if (SC_Utils_Ex::isBlank($productsClass1)) { 
     318                if (!$this->classCat1_find[$productId]) { 
    319319                    $productsClass1 = '__unselected2'; 
    320320                } 
    321321                $classCategories[$productsClass1]['#'] = array( 
     
    355355            T1.product_type_id, 
    356356            T1.down_filename, 
    357357            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 
    366368__EOS__; 
    367369        $table = <<< __EOS__ 
    368370                      dtb_products_class T1 
    369             LEFT JOIN dtb_class_combination T2 
    370                    ON T1.class_combination_id = T2.class_combination_id 
    371371            LEFT JOIN dtb_classcategory T3 
    372                    ON T2.classcategory_id = T3.classcategory_id 
     372                   ON T1.classcategory_id1 = T3.classcategory_id 
    373373            LEFT JOIN dtb_class T4 
    374374                   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 
    375379__EOS__; 
    376380 
    377381        $objQuery->setOrder('T3.rank DESC'); // XXX 
    378382        $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), '?')) . ')'); 
    391383 
    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; 
    438385    } 
    439386 
    440387    /** 
     
    788735        ( 
    789736             SELECT dtb_products.*, 
    790737                    dtb_products_class.product_class_id, 
    791                     dtb_products_class.class_combination_id, 
     738                    'dummy' AS class_combination_id, 
    792739                    dtb_products_class.product_type_id, 
    793740                    dtb_products_class.product_code, 
    794741                    dtb_products_class.stock, 
     
    800747                    dtb_products_class.point_rate, 
    801748                    dtb_products_class.down_filename, 
    802749                    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, -- 削除 
    808757                    Tcc1.class_id as class_id, 
    809758                    Tcc1.name as classcategory_name, 
    810759                    Tcc2.class_id as parent_class_id, 
     
    812761             FROM dtb_products 
    813762                 LEFT JOIN dtb_products_class 
    814763                     ON dtb_products.product_id = dtb_products_class.product_id 
    815                  LEFT JOIN dtb_class_combination 
    816                      ON dtb_products_class.class_combination_id = dtb_class_combination.class_combination_id 
    817                  LEFT JOIN dtb_class_combination as Tpcm 
    818                      ON dtb_class_combination.parent_class_combination_id = Tpcm.class_combination_id 
    819764                 LEFT JOIN dtb_classcategory as Tcc1 
    820                      ON dtb_class_combination.classcategory_id = Tcc1.classcategory_id 
     765                     ON dtb_products_class.classcategory_id1 = Tcc1.classcategory_id 
    821766                 LEFT JOIN dtb_classcategory as Tcc2 
    822                      ON Tpcm.classcategory_id = Tcc2.classcategory_id 
     767                     ON dtb_products_class.classcategory_id2 = Tcc2.classcategory_id 
    823768             $where_clause 
    824769        ) as prdcls 
    825770__EOS__; 
  • html/install/index.php

     
    10531053                 array("dtb_payment", "payment_id"), 
    10541054                 array("dtb_products_class", "product_class_id"), 
    10551055                 array("dtb_products", "product_id"), 
    1056                  array("dtb_class_combination", "class_combination_id"), 
    10571056                 array("dtb_review", "review_id"), 
    10581057                 array("dtb_send_history", "send_id"), 
    10591058                 array("dtb_mailmaga_template", "template_id")); 
  • html/install/sql/create_table_mysql.sql

     
    315315CREATE TABLE dtb_products_class ( 
    316316    product_class_id int  NOT NULL, 
    317317    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, 
    319320    product_type_id int NOT NULL DEFAULT 0, 
    320321    product_code text, 
    321322    stock numeric, 
     
    357358    PRIMARY KEY (classcategory_id) 
    358359) ENGINE=InnoDB; 
    359360 
    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  
    368361CREATE TABLE dtb_category ( 
    369362    category_id int  NOT NULL, 
    370363    category_name text, 
  • html/install/sql/create_table_pgsql.sql

     
    315315CREATE TABLE dtb_products_class ( 
    316316    product_class_id int NOT NULL, 
    317317    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, 
    319320    product_type_id int NOT NULL DEFAULT 0, 
    320321    product_code text, 
    321322    stock numeric, 
     
    357358    PRIMARY KEY (classcategory_id) 
    358359); 
    359360 
    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  
    368361CREATE TABLE dtb_category ( 
    369362    category_id int NOT NULL, 
    370363    category_name text, 
  • html/install/sql/drop_table.sql

     
    1515DROP TABLE dtb_product_status; 
    1616DROP TABLE dtb_class; 
    1717DROP TABLE dtb_classcategory; 
    18 DROP TABLE dtb_class_combination; 
    1918DROP TABLE dtb_category; 
    2019DROP TABLE dtb_recommend_products; 
    2120DROP TABLE dtb_review; 
  • html/install/sql/insert_data.sql

     
    236236 
    237237INSERT 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'); 
    238238INSERT 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'); 
    241239INSERT 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'); 
    242240INSERT 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'); 
    243241INSERT 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'); 
     
    395393INSERT 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'); 
    396394INSERT 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'); 
    397395INSERT 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'); 
     396UPDATE dtb_csv SET no = no - 2 WHERE no > 2; 
     397UPDATE dtb_csv SET rank = rank - 2 WHERE csv_id = 1 AND rank > 2; 
    398398 
    399399INSERT 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); 
    400400INSERT 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); 
     
    703703INSERT 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); 
    704704INSERT 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); 
    705705 
    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'); 
     706INSERT 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); 
     707INSERT 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); 
     708INSERT 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); 
     709INSERT 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); 
     710INSERT 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); 
     711INSERT 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); 
     712INSERT 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); 
     713INSERT 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); 
     714INSERT 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); 
     715INSERT 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); 
     716INSERT 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); 
     717INSERT 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'); 
    718718 
    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  
    738719INSERT 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); 
    739720INSERT 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); 
    740721INSERT 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

     
    5757 
    5858$objData = new CreateEcCubeData(); 
    5959$start = microtime_float(); 
    60 //$objData->objQuery->begin(); 
     60$objData->objQuery->begin(); 
    6161 
    6262// カテゴリ生成 
    6363$objData->createCategories(); 
     
    7474$objDb->sfCountCategory(NULL, true); 
    7575 
    7676//$objData->objQuery->rollback(); 
    77 //$objData->objQuery->commit(); 
     77$objData->objQuery->commit(); 
    7878$end = microtime_float(); 
    7979print("データの生成が完了しました!\n"); 
    8080printf("所要時間 %f 秒\n", $end - $start); 
     
    107107    var $arrClassCategory_id2 = array(); 
    108108 
    109109    /** 削除するか */ 
    110     var $delete = false; 
     110    var $delete = true; 
    111111 
    112112    /** 
    113113     * コンストラクタ. 
     
    242242        print("商品と規格の関連づけを行います...\n"); 
    243243 
    244244        if ($this->delete) { 
    245             $this->objQuery->delete('dtb_class_combination'); 
    246245            $this->objQuery->delete('dtb_products_class'); 
    247246        } 
    248247 
     
    271270            $sqlval['status'] = 1; 
    272271            $sqlval['comment3'] = "コメント"; 
    273272            $sqlval['main_list_comment'] = "コメント"; 
    274             $sqlval['main_list_image'] = "08311201_44f65122ee5fe.jpg"; 
     273            $sqlval['main_list_image'] = "nabe130.jpg"; 
    275274            $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"; 
    278277            $sqlval['sub_comment1'] = "コメント"; 
    279278            $sqlval['del_flg'] = (string) "0"; 
    280279            $sqlval['creator_id'] = 2; 
     
    373372        $sqlval['update_date'] = 'CURRENT_TIMESTAMP'; 
    374373        $sqlval['del_flg'] = 0; 
    375374 
    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; 
    395381                $this->objQuery->insert("dtb_products_class", $sqlval); 
    396382 
    397                 $count++; 
    398383                print("#"); 
    399384            } 
    400385        } 
    401386 
    402387        // 規格無し用 
    403388        $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; 
    405392        $sqlval['del_flg'] = 1; 
    406393        $this->objQuery->insert("dtb_products_class", $sqlval); 
    407394 
     
    462449                         ,"43" 
    463450                         ,"42" 
    464451                         ,"41" 
    465                          ,"43(27.0cm?27.5cm)" 
    466                          ,"42(26.5cm?27.0cm)" 
    467                          ,"37(ladies 23.5?24cm)" 
     452                         ,"43(27.0cm27.5cm)" 
     453                         ,"42(26.5cm27.0cm)" 
     454                         ,"37(ladies 23.524cm)" 
    468455                         ,"42(約27.5cm)" 
    469456                         ,"41(約26.5cm)" 
    470457                         ,"W36" 
Note: See TracBrowser for help on using the repository browser.