Changeset 20556


Ignore:
Timestamp:
2011/03/08 20:20:38 (13 years ago)
Author:
kotani
Message:

#1074 ([管理画面]商品複製時にエラー)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Product.php

    r20538 r20556  
    976976            // 複製商品の場合には規格も複製する 
    977977            if($arrList["copy_product_id"] != "" && SC_Utils_Ex::sfIsInt($arrList["copy_product_id"])) { 
    978                 if($arrList["has_product_class"] == "1") { 
     978                if($this->lfGetProductClassFlag($arrList["has_product_class"]) == false) { 
    979979                    //規格なしの場合、複製は価格等の入力が発生しているため、その内容で追加登録を行う 
    980980                    $this->lfCopyProductClass($arrList, $objQuery); 
     
    991991                    unset($arrColList[$arrColList_tmp["create_date"]]); 
    992992 
     993                    // 複製元商品の規格データ取得 
    993994                    $col = SC_Utils_Ex::sfGetCommaList($arrColList); 
    994                     $product_class_id = $objQuery->nextVal('dtb_products_class_product_class_id'); 
    995                     $objQuery->query("INSERT INTO dtb_products_class (product_class_id, product_id, create_date, ". $col .") SELECT ?, now(), " . $col. " FROM dtb_products_class WHERE product_id = ? ORDER BY product_class_id", array($product_class_id, $product_id, $arrList["copy_product_id"])); 
     995                    $table = 'dtb_products_class'; 
     996                    $where = 'product_id = ?'; 
     997                    $objQuery->setOrder('product_class_id'); 
     998                    $arrProductsClass = $objQuery->select($col, $table, $where, array($arrList["copy_product_id"])); 
     999 
     1000                    // 規格データ登録 
     1001                    foreach($arrProductsClass as $arrData) { 
     1002                        $sqlval = array(); 
     1003                        $sqlval['product_class_id'] = $objQuery->nextVal('dtb_products_class_product_class_id'); 
     1004                        $sqlval['product_id'] = $product_id; 
     1005                        $sqlval['create_date'] = 'now()'; 
     1006                        $sqlval['class_combination_id'] = $arrData['class_combination_id']; 
     1007                        $sqlval['product_type_id'] = $arrData['product_type_id']; 
     1008                        $sqlval['product_code'] = $arrData['product_code']; 
     1009                        $sqlval['stock'] = $arrData['stock']; 
     1010                        $sqlval['stock_unlimited'] = $arrData['stock_unlimited']; 
     1011                        $sqlval['sale_limit'] = $arrData['sale_limit']; 
     1012                        $sqlval['price01'] = $arrData['price01']; 
     1013                        $sqlval['price02'] = $arrData['price02']; 
     1014                        $sqlval['deliv_fee'] = $arrData['deliv_fee']; 
     1015                        $sqlval['point_rate'] = $arrData['point_rate']; 
     1016                        $sqlval['creator_id'] = $arrData['creator_id']; 
     1017                        $sqlval['update_date'] = $arrData['update_date']; 
     1018                        $sqlval['down_filename'] = $arrData['down_filename']; 
     1019                        $sqlval['down_realfilename'] = $arrData['down_realfilename']; 
     1020                        $sqlval['del_flg'] = $arrData['del_flg']; 
     1021                        $objQuery->insert($table, $sqlval); 
     1022                    } 
    9961023                } 
    9971024            } 
     
    11311158            foreach($records as $key => $value) { 
    11321159                if(isset($arrList[$key])) { 
    1133                     $records[$key] = $arrList[$key]; 
     1160                    switch($key) { 
     1161                    case 'stock_unlimited': 
     1162                        $records[$key] = (int)$arrList[$key]; 
     1163                        break; 
     1164                    default: 
     1165                        $records[$key] = $arrList[$key]; 
     1166                        break; 
     1167                    } 
    11341168                } 
    11351169            } 
Note: See TracChangeset for help on using the changeset viewer.