Changeset 18023


Ignore:
Timestamp:
2009/05/23 11:23:24 (14 years ago)
Author:
Seasoft
Message:

#472「管理機能の配送業者の追加でエラー」を修正。

Location:
branches/comu-ver2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/class/helper/SC_Helper_DB.php

    r17994 r18023  
    425425                $objQuery->update("dtb_order_temp", $sqlval, $where, array($uniqid)); 
    426426            } 
     427             
     428            // 受注_Tempテーブルの名称列を更新 
     429            $this->sfUpdateOrderNameCol($uniqid, true); 
    427430        } 
    428431    } 
     
    17121715    } 
    17131716 
     1717    /** 
     1718     * 受注の名称列を更新する 
     1719     * 
     1720     * @param integer $order_id 更新対象の注文番号 
     1721     * @param boolean $temp_table 更新対象は「受注_Temp」か 
     1722     */ 
     1723    function sfUpdateOrderNameCol($order_id, $temp_table = false) { 
     1724        $objQuery = new SC_Query(); 
     1725         
     1726        if ($temp_table) { 
     1727            $table = 'dtb_order_temp'; 
     1728            $sql_where = 'WHERE order_temp_id = ?'; 
     1729        } else { 
     1730            $table = 'dtb_order'; 
     1731            $sql_where = 'WHERE order_id = ?'; 
     1732        } 
     1733         
     1734        $sql = <<< __EOS__ 
     1735            UPDATE 
     1736                $table tgt 
     1737            SET 
     1738                 payment_method = (SELECT payment_method FROM dtb_payment WHERE payment_id = tgt.payment_id) 
     1739                ,deliv_time = (SELECT deliv_time FROM dtb_delivtime WHERE time_id = tgt.deliv_time_id AND deliv_id = tgt.deliv_id) 
     1740            $sql_where 
     1741__EOS__; 
     1742         
     1743        $objQuery->query($sql, array($order_id)); 
     1744    } 
    17141745} 
    17151746?> 
  • branches/comu-ver2/data/class/pages/admin/basis/LC_Page_Admin_Basis_Delivery_Input.php

    r17580 r18023  
    163163                $sqlval = array(); 
    164164                $keyname = "deliv_time".$cnt; 
    165                 $arrval = array($deliv_id, ($cnt * $deliv_id)); 
     165                $arrval = array($deliv_id, $cnt); 
    166166                // 既存データの有無を確認 
    167167                $curData = $objQuery->select("*", $table, $where, $arrval); 
     
    177177                    else { 
    178178                        $sqlval['deliv_id'] = $deliv_id; 
    179                         $sqlval['time_id'] = ($cnt * $deliv_id); 
     179                        $sqlval['time_id'] = $cnt; 
    180180                        $objQuery->insert($table, $sqlval); 
    181181                    } 
     
    221221                if($arrRet[$keyname] != "") { 
    222222                    $sqlval['deliv_id'] = $deliv_id; 
    223                     $sqlval['time_id'] = ($cnt * $deliv_id); 
     223                    $sqlval['time_id'] = $cnt; 
    224224                    $sqlval['deliv_time'] = $arrRet[$keyname]; 
    225225                    // INSERTの実行 
  • branches/comu-ver2/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php

    r18015 r18023  
    552552        // 受注テーブルの更新 
    553553        $objQuery->update("dtb_order", $sqlval, $where, array($order_id), $addcol); 
    554  
    555         $sql = ""; 
    556         $sql .= " UPDATE"; 
    557         $sql .= "     dtb_order"; 
    558         $sql .= " SET"; 
    559         $sql .= "     payment_method = (SELECT payment_method FROM dtb_payment WHERE payment_id = ?)"; 
    560         $sql .= "     ,deliv_time = (SELECT deliv_time FROM dtb_delivtime WHERE time_id = ? AND deliv_id = (SELECT deliv_id FROM dtb_payment WHERE payment_id = ? ))"; 
    561         $sql .= " WHERE order_id = ?"; 
    562  
    563         if ($arrRet['deliv_time_id'] == "") { 
    564             $deliv_time_id = 0; 
    565         }else{ 
    566             $deliv_time_id = $arrRet['deliv_time_id']; 
    567         } 
    568         $arrUpdData = array($arrRet['payment_id'], $deliv_time_id, $arrRet['payment_id'], $order_id); 
    569         $objQuery->query($sql, $arrUpdData); 
    570  
     554         
     555        // 受注テーブルの名称列を更新 
     556        $objDb = new SC_Helper_DB_Ex(); 
     557        $objDb->sfUpdateOrderNameCol($order_id); 
     558         
    571559        // 受注詳細データの更新 
    572560        $arrDetail = $this->objFormParam->getSwapArray(array("product_id", "product_code", "product_name", "price", "quantity", "point_rate", "classcategory_id1", "classcategory_id2", "classcategory_name1", "classcategory_name2")); 
     
    660648        $order_id = $objQuery->currval('dtb_order', 'order_id');  
    661649         
    662         $sql = ""; 
    663         $sql .= " UPDATE"; 
    664         $sql .= "     dtb_order"; 
    665         $sql .= " SET"; 
    666         $sql .= "     payment_method = (SELECT payment_method FROM dtb_payment WHERE payment_id = ?)"; 
    667         $sql .= "     ,deliv_time = (SELECT deliv_time FROM dtb_delivtime WHERE time_id = ? AND deliv_id = (SELECT deliv_id FROM dtb_payment WHERE payment_id = ? ))"; 
    668         $sql .= " WHERE order_id = ?"; 
    669  
    670         if ($arrRet['deliv_time_id'] == "") { 
    671             $deliv_time_id = 0; 
    672         }else{ 
    673             $deliv_time_id = $arrRet['deliv_time_id']; 
    674         } 
    675         $arrUpdData = array($arrRet['payment_id'], $deliv_time_id, $arrRet['payment_id'], $order_id); 
    676         $objQuery->query($sql, $arrUpdData); 
    677  
     650        // 受注テーブルの名称列を更新 
     651        $objDb = new SC_Helper_DB_Ex(); 
     652        $objDb->sfUpdateOrderNameCol($order_id); 
     653         
    678654        // 受注詳細データの更新 
    679655        $arrDetail = $this->objFormParam->getSwapArray(array("product_id", "product_code", "product_name", "price", "quantity", "point_rate", "classcategory_id1", "classcategory_id2", "classcategory_name1", "classcategory_name2")); 
  • branches/comu-ver2/data/class/pages/shopping/LC_Page_Shopping_Payment.php

    r17969 r18023  
    420420        $objQuery = new SC_Query(); 
    421421        $where = "payment_id = ?"; 
    422         $arrRet = $objQuery->select("payment_method, charge", "dtb_payment", $where, array($payment_id)); 
    423         return (array($arrRet[0]['payment_method'], $arrRet[0]['charge'])); 
    424     } 
    425  
    426     /* 配送時間文字列の取得 */ 
    427     function lfGetDelivTimeInfo($time_id) { 
    428         $objQuery = new SC_Query(); 
    429         $where = "time_id = ?"; 
    430         $arrRet = $objQuery->select("deliv_id, deliv_time", "dtb_delivtime", $where, array($time_id)); 
    431         return (array($arrRet[0]['deliv_id'], $arrRet[0]['deliv_time'])); 
     422        $arrRet = $objQuery->select("charge, deliv_id", "dtb_payment", $where, array($payment_id)); 
     423        return (array($arrRet[0]['charge'], $arrRet[0]['deliv_id'])); 
    432424    } 
    433425 
    434426    /* DBへデータの登録 */ 
    435427    function lfRegistData($uniqid) { 
    436         $arrRet = $this->objFormParam->getHashArray(); 
     428        $objDb = new SC_Helper_DB_Ex(); 
     429         
    437430        $sqlval = $this->objFormParam->getDbArray(); 
    438431        // 登録データの作成 
     
    440433        $sqlval['update_date'] = 'Now()'; 
    441434 
    442         if($sqlval['payment_id'] != "") { 
    443             list($sqlval['payment_method'], $sqlval['charge']) = $this->lfGetPaymentInfo($sqlval['payment_id']); 
    444         } else { 
    445             $sqlval['payment_id'] = '0'; 
    446             $sqlval['payment_method'] = ""; 
    447         } 
    448  
    449         if($sqlval['deliv_time_id'] != "") { 
    450             list($sqlval['deliv_id'], $sqlval['deliv_time']) = $this->lfGetDelivTimeInfo($sqlval['deliv_time_id']); 
    451         } else { 
    452             $sqlval['deliv_time_id'] = '0'; 
    453             $sqlval['deliv_id'] = '0'; 
    454             $sqlval['deliv_time'] = ""; 
     435        if (strlen($sqlval['payment_id']) >= 1) { 
     436            list($sqlval['charge'], $sqlval['deliv_id']) = $this->lfGetPaymentInfo($sqlval['payment_id']); 
    455437        } 
    456438 
     
    460442        } 
    461443 
    462         $objDb = new SC_Helper_DB_Ex(); 
     444        // 受注_Tempテーブルに登録 
    463445        $objDb->sfRegistTempOrder($uniqid, $sqlval); 
    464446    } 
  • branches/comu-ver2/html/install/sql/create_table_mysql.sql

    r17864 r18023  
    161161CREATE TABLE dtb_delivtime ( 
    162162    deliv_id int NOT NULL, 
    163     time_id int auto_increment primary key NOT NULL, 
    164     deliv_time text NOT NULL 
     163    time_id int NOT NULL, 
     164    deliv_time text NOT NULL, 
     165    PRIMARY KEY (deliv_id, time_id) 
    165166) TYPE=InnoDB ; 
    166167 
  • branches/comu-ver2/html/install/sql/create_table_pgsql.sql

    r17873 r18023  
    165165CREATE TABLE dtb_delivtime ( 
    166166    deliv_id int4 NOT NULL, 
    167     time_id serial NOT NULL, 
     167    time_id int4 NOT NULL, 
    168168    deliv_time text NOT NULL, 
    169     PRIMARY KEY (time_id) 
     169    PRIMARY KEY (deliv_id, time_id) 
    170170); 
    171171 
  • branches/comu-ver2/html/install/sql/insert_data.sql

    r18021 r18023  
    310310INSERT INTO dtb_delivfee (deliv_id,fee,pref) VALUES (1, '1000', 47); 
    311311 
    312 INSERT INTO dtb_delivtime (deliv_id, deliv_time) VALUES (1, '午前'); 
    313 INSERT INTO dtb_delivtime (deliv_id, deliv_time) VALUES (1, '午後'); 
     312INSERT INTO dtb_delivtime (deliv_id, time_id, deliv_time) VALUES (1, 1, '午前'); 
     313INSERT INTO dtb_delivtime (deliv_id, time_id, deliv_time) VALUES (1, 2, '午後'); 
    314314 
    315315INSERT INTO dtb_payment (payment_method,charge,rule,deliv_id,rank,note,fix,status,del_flg,creator_id,create_date,update_date,payment_image,upper_rule) VALUES ('郵便振替', 0, NULL, 1, 4, NULL, 2, 1, 0, 1, now(), now(), NULL, NULL); 
Note: See TracChangeset for help on using the changeset viewer.