Ignore:
Timestamp:
2012/11/02 19:27:41 (11 years ago)
Author:
pineray
Message:

#1958 別お届け先関連の処理をページクラスから分離

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/pages/shopping/LC_Page_Shopping_Multiple.php

    r21951 r22065  
    7171        $objCustomer = new SC_Customer_Ex(); 
    7272        $objFormParam = new SC_FormParam_Ex(); 
     73        $objAddress = new SC_Helper_Address_Ex(); 
    7374 
    7475        // 複数配送先指定が無効な場合はエラー 
     
    8182 
    8283        $this->addrs = $this->getDelivAddrs($objCustomer, $objPurchase, 
    83                                             $this->tpl_uniqid); 
     84                                            $objAddress, $this->tpl_uniqid); 
    8485        $this->tpl_addrmax = count($this->addrs); 
    8586        $this->lfInitParam($objFormParam); 
     
    9697                    $this->saveMultipleShippings($this->tpl_uniqid, $objFormParam, 
    9798                                                 $objCustomer, $objPurchase, 
    98                                                  $objCartSess); 
     99                                                 $objCartSess, $objAddress); 
    99100                    $objSiteSess->setRegistFlag(); 
    100101 
     
    187188     * @return array 配送住所のプルダウン用連想配列 
    188189     */ 
    189     function getDelivAddrs(&$objCustomer, &$objPurchase, $uniqid) { 
     190    function getDelivAddrs(&$objCustomer, &$objPurchase, &$objAddress, $uniqid) { 
    190191        $masterData = new SC_DB_MasterData_Ex(); 
    191192        $arrPref = $masterData->getMasterData('mtb_pref'); 
     
    194195        // 会員ログイン時 
    195196        if ($objCustomer->isLoginSuccess(true)) { 
    196             $arrAddrs = $objCustomer->getCustomerAddress($objCustomer->getValue('customer_id')); 
     197            $addr = array( 
     198                array( 
     199                    'other_deliv_id'    => NULL, 
     200                    'customer_id'       => $objCustomer->getValue('customer_id'), 
     201                    'name01'            => $objCustomer->getValue('name01'), 
     202                    'name02'            => $objCustomer->getValue('name02'), 
     203                    'kana01'            => $objCustomer->getValue('kana01'), 
     204                    'kana02'            => $objCustomer->getValue('kana02'), 
     205                    'zip01'             => $objCustomer->getValue('zip01'), 
     206                    'zip02'             => $objCustomer->getValue('zip02'), 
     207                    'pref'              => $objCustomer->getValue('pref'), 
     208                    'addr01'            => $objCustomer->getValue('addr01'), 
     209                    'addr02'            => $objCustomer->getValue('addr02'), 
     210                    'tel01'             => $objCustomer->getValue('tel01'), 
     211                    'tel02'             => $objCustomer->getValue('tel02'), 
     212                    'tel03'             => $objCustomer->getValue('tel03'), 
     213                ) 
     214            ); 
     215            $arrAddrs = array_merge($addr, $objAddress->getList($objCustomer->getValue('customer_id'))); 
    197216            foreach ($arrAddrs as $val) { 
    198217                $other_deliv_id = SC_Utils_Ex::isBlank($val['other_deliv_id']) ? 0 : $val['other_deliv_id']; 
     
    280299     * @return void 
    281300     */ 
    282     function saveMultipleShippings($uniqid, &$objFormParam, &$objCustomer, &$objPurchase, &$objCartSess) { 
     301    function saveMultipleShippings($uniqid, &$objFormParam, &$objCustomer, &$objPurchase, &$objCartSess, &$objAddress) { 
    283302        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    284303 
     
    290309            if ($objCustomer->isLoginSuccess(true)) { 
    291310                if ($other_deliv_id != 0) { 
    292                     $otherDeliv = $objQuery->select('*', 'dtb_other_deliv', 
    293                                                     'other_deliv_id = ?', 
    294                                                     array($other_deliv_id)); 
    295                     foreach ($otherDeliv[0] as $key => $val) { 
     311                    $otherDeliv = $objAddress->getAddress($objCustomer->getValue('customer_id'), $other_deliv_id); 
     312                    foreach ($otherDeliv as $key => $val) { 
    296313                        $arrValues[$other_deliv_id]['shipping_' . $key] = $val; 
    297314                    } 
Note: See TracChangeset for help on using the changeset viewer.