Ignore:
Timestamp:
2007/09/05 17:00:49 (17 years ago)
Author:
nanasess
Message:

リファクタリング

  • クラス化に伴う修正
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/pages/shopping/LC_Page_Shopping_Complete.php

    r15532 r15622  
    1414 * @package Page 
    1515 * @author LOCKON CO.,LTD. 
    16  * @version $Id$ 
     16 * @version $Id:LC_Page_Shopping_Complete.php 15532 2007-08-31 14:39:46Z nanasess $ 
    1717 */ 
    1818class LC_Page_Shopping_Complete extends LC_Page { 
     
    3232        $this->tpl_title = "ご注文完了"; 
    3333 
    34         // TODO 
    35         $this->arrCONVENIENCE = $arrCONVENIENCE; 
    36         $this->arrCONVENIMESSAGE = $arrCONVENIMESSAGE; 
    37         $objPage->arrCONVENIENCE = $arrCONVENIENCE; 
    38         $objPage->arrCONVENIMESSAGE = $arrCONVENIMESSAGE; 
     34        $masterData = new SC_DB_MasterData_Ex(); 
     35        $this->arrCONVENIENCE = $masterData->getMasterData("mtb_convenience"); 
     36        $this->arrCONVENIMESSAGE = $masterData->getMasterData("mtb_conveni_message"); 
    3937 
    4038        $this->allowClientCache(); 
     
    5553        $this->arrInfo = $objSiteInfo->data; 
    5654        $this->objCustomer = new SC_Customer(); 
     55        $mailHelper = new SC_Helper_Mail_Ex(); 
    5756 
    5857        // 前のページで正しく登録手続きが行われたか判定 
    59         SC_Utils_Ex::sfIsPrePage($objSiteSess); 
     58        SC_Utils_Ex::sfIsPrePage($this->objSiteSess); 
    6059        // ユーザユニークIDの取得と購入状態の正当性をチェック 
    61         $uniqid = SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess); 
     60        $uniqid = SC_Utils_Ex::sfCheckNormalAccess($this->objSiteSess, $this->objCartSess); 
    6261        if ($uniqid != "") { 
    6362 
     
    6564            $objQuery = new SC_Query(); 
    6665            $objQuery->begin(); 
    67             $order_id = lfDoComplete($objQuery, $uniqid); 
     66            $order_id = $this->lfDoComplete($objQuery, $uniqid); 
    6867            $objQuery->commit(); 
    6968 
    7069            // セッションに保管されている情報を更新する 
    71             $objCustomer->updateSession(); 
     70            $this->objCustomer->updateSession(); 
    7271 
    7372            // 完了メール送信 
    7473            if($order_id != "") { 
    75                 SC_Utils_Ex::sfSendOrderMail($order_id, '1'); 
     74                $mailHelper->sfSendOrderMail($order_id, '1'); 
    7675            } 
    7776 
     
    109108        } 
    110109 
    111         $this->arrInfo = $arrInfo; 
    112110        // キャンペーンからの遷移かチェック 
    113         $this->is_campaign = $objCampaignSess->getIsCampaign(); 
    114         $this->campaign_dir = $objCampaignSess->getCampaignDir(); 
     111        $this->is_campaign = $this->objCampaignSess->getIsCampaign(); 
     112        $this->campaign_dir = $this->objCampaignSess->getCampaignDir(); 
    115113 
    116114        $objView->assignobj($this); 
    117115        // フレームを選択(キャンペーンページから遷移なら変更) 
    118         $objCampaignSess->pageView($objView); 
     116        $this->objCampaignSess->pageView($objView); 
    119117 
    120118        // セッション開放 
    121         $objCampaignSess->delCampaign(); 
     119        $this->objCampaignSess->delCampaign(); 
    122120    } 
    123121 
     
    179177 
    180178    // 完了処理 
    181     function lfDoComplete($objQuery, $uniqid) { 
     179    function lfDoComplete(&$objQuery, $uniqid) { 
    182180        $objDb = new SC_Helper_DB_Ex(); 
    183181 
     
    186184 
    187185        // 会員情報登録処理 
    188         if ($objCustomer->isLoginSuccess()) { 
     186        if ($this->objCustomer->isLoginSuccess()) { 
    189187            // 新お届け先の登録 
    190             $this->lfSetNewAddr($uniqid, $objCustomer->getValue('customer_id')); 
     188            $this->lfSetNewAddr($uniqid, $this->objCustomer->getValue('customer_id')); 
    191189            // 購入集計を顧客テーブルに反映 
    192             $this->lfSetCustomerPurchase($objCustomer->getValue('customer_id'), $arrData, $objQuery); 
     190            $this->lfSetCustomerPurchase($this->objCustomer->getValue('customer_id'), $arrData, $objQuery); 
    193191        } else { 
    194192            //購入時強制会員登録 
     
    199197                if($arrData['member_check'] == '1') { 
    200198                    // 仮会員登録 
    201                     $customer_id = $this->lfRegistPreCustomer($arrData, $arrInfo); 
     199                    $customer_id = $this->lfRegistPreCustomer($arrData, $this->arrInfo); 
    202200                    // 購入集計を顧客テーブルに反映 
    203201                    $this->lfSetCustomerPurchase($customer_id, $arrData, $objQuery); 
     
    207205            case '1': 
    208206                // 仮会員登録 
    209                 $customer_id = $this->lfRegistPreCustomer($arrData, $arrInfo); 
     207                $customer_id = $this->lfRegistPreCustomer($arrData, $this->arrInfo); 
    210208                // 購入集計を顧客テーブルに反映 
    211209                $this->lfSetCustomerPurchase($customer_id, $arrData, $objQuery); 
     
    215213        } 
    216214        // 一時テーブルを受注テーブルに格納する 
    217         $order_id = $this->lfRegistOrder($objQuery, $arrData, $objCampaignSess); 
     215        $order_id = $this->lfRegistOrder($objQuery, $arrData, $this->objCampaignSess); 
    218216        // カート商品を受注詳細テーブルに格納する 
    219         $this->lfRegistOrderDetail($objQuery, $order_id, $objCartSess); 
     217        $this->lfRegistOrderDetail($objQuery, $order_id, $this->objCartSess); 
    220218        // 受注一時テーブルの情報を削除する。 
    221219        $this->lfDeleteTempOrder($objQuery, $uniqid); 
    222220        // キャンペーンからの遷移の場合登録する。 
    223         if($objCampaignSess->getIsCampaign() and $objCartSess->chkCampaign($objCampaignSess->getCampaignId())) { 
     221        if($this->objCampaignSess->getIsCampaign() and $this->objCartSess->chkCampaign($this->objCampaignSess->getCampaignId())) { 
    224222            $this->lfRegistCampaignOrder($objQuery, $objCampaignSess, $order_id); 
    225223        } 
    226224 
    227225        // セッションカート内の商品を削除する。 
    228         $objCartSess->delAllProducts(); 
     226        $this->objCartSess->delAllProducts(); 
    229227        // 注文一時IDを解除する。 
    230         $objSiteSess->unsetUniqId(); 
     228        $this->objSiteSess->unsetUniqId(); 
    231229 
    232230        return $order_id; 
     
    299297        $body = $objMailView->fetch("mail_templates/customer_mail.tpl"); 
    300298 
     299        $mailHelper = new SC_Helper_Mail_Ex(); 
     300 
    301301        $objMail = new GC_SendMail(); 
    302302        $objMail->setItem( 
    303303                            ''                                      // 宛先 
    304                             , sfMakeSubject("会員登録のご確認")     // サブジェクト 
     304                            , $mailHelper->sfMakeSubject("会員登録のご確認")        // サブジェクト 
    305305                            , $body                                 // 本文 
    306306                            , $arrInfo['email03']                   // 配送元アドレス 
     
    371371 
    372372    // 受注詳細テーブルへ登録 
    373     function lfRegistOrderDetail($objQuery, $order_id, $objCartSess) { 
     373    function lfRegistOrderDetail(&$objQuery, $order_id, &$objCartSess) { 
    374374        $objDb = new SC_Helper_DB_Ex(); 
    375375        // カート内情報の取得 
     
    412412 
    413413    // キャンペーン受注テーブルへ登録 
    414     function lfRegistCampaignOrder($objQuery, $objCampaignSess, $order_id) { 
     414    function lfRegistCampaignOrder(&$objQuery, &$objCampaignSess, $order_id) { 
    415415 
    416416        // 受注データを取得 
     
    440440 
    441441    /* 受注一時テーブルの削除 */ 
    442     function lfDeleteTempOrder($objQuery, $uniqid) { 
     442    function lfDeleteTempOrder(&$objQuery, $uniqid) { 
    443443        $where = "order_temp_id = ?"; 
    444444        $sqlval['del_flg'] = 1; 
     
    496496 
    497497    /* 購入情報を会員テーブルに登録する */ 
    498     function lfSetCustomerPurchase($customer_id, $arrData, $objQuery) { 
     498    function lfSetCustomerPurchase($customer_id, $arrData, &$objQuery) { 
    499499        $col = "first_buy_date, last_buy_date, buy_times, buy_total, point"; 
    500500        $where = "customer_id = ?"; 
     
    520520 
    521521    // 在庫を減らす処理 
    522     function lfReduceStock($objQuery, $arrID, $quantity) { 
     522    function lfReduceStock(&$objQuery, $arrID, $quantity) { 
    523523        $where = "product_id = ? AND classcategory_id1 = ? AND classcategory_id2 = ?"; 
    524524        $arrRet = $objQuery->select("stock, stock_unlimited", "dtb_products_class", $where, $arrID); 
     
    544544    // GETの値をインサート用に整える 
    545545    function lfGetInsParam($sqlVal){ 
    546  
     546        $objDb = new SC_Helper_DB_Ex(); 
    547547        foreach($_GET as $key => $val){ 
    548548            // カラムの存在チェック 
    549             if(sfColumnExists("dtb_order", $key)) $sqlVal[$key] = $val; 
     549            if($objDb->sfColumnExists("dtb_order", $key)) $sqlVal[$key] = $val; 
    550550        } 
    551551 
Note: See TracChangeset for help on using the changeset viewer.