Ignore:
Timestamp:
2014/05/12 13:36:22 (10 years ago)
Author:
m_uehara
Message:

#2541 SC_Helper_Addressの処理の改善

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_13_2/data/class/helper/SC_Helper_Address.php

    r23279 r23408  
    4040    { 
    4141        if (self::delivErrorCheck($sqlval)) { 
    42             SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, "入力値が不正です。<br />正しい値を入力してください。"); 
    43             SC_Response_Ex::actionExit(); 
     42            return false; 
    4443        } 
    4544         
     
    5655            $deliv_count = $objQuery->count($from, $where, $arrVal); 
    5756            if ($deliv_count >= DELIV_ADDR_MAX) { 
    58                 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先最大登録数に達しています。'); 
    59                 SC_Response_Ex::actionExit(); 
     57                return false; 
    6058            } 
    6159 
    6260            // 別のお届け先を追加 
    6361            $sqlval['other_deliv_id'] = $objQuery->nextVal('dtb_other_deliv_other_deliv_id'); 
    64             $objQuery->insert($from, $sqlval); 
     62            $ret = $objQuery->insert($from, $sqlval); 
    6563 
    6664        // 変更 
     
    7169            $deliv_count = $objQuery->count($from, $where, $arrVal); 
    7270            if ($deliv_count != 1) { 
    73                 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '一致する別のお届け先がありません。'); 
    74                 SC_Response_Ex::actionExit(); 
     71                return false; 
    7572            } 
    7673 
    7774            // 別のお届け先を変更 
    78             $objQuery->update($from, $sqlval, $where, $arrVal); 
     75            $ret = $objQuery->update($from, $sqlval, $where, $arrVal); 
    7976        } 
     77         
     78        return $ret; 
    8079    } 
    8180 
     
    8685     * @return array() 
    8786     */ 
    88     public function getAddress($other_deliv_id) 
     87    public function getAddress($other_deliv_id, $customer_id = '') 
    8988    { 
    90         $objCustomer = new SC_Customer_Ex(); 
    91         $customer_id = $objCustomer->getValue('customer_id'); 
    92          
    9389        if (self::delivErrorCheck(array('customer_id' => $customer_id, 'other_deliv_id' => $other_deliv_id))) { 
    94             SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, "入力値が不正です。<br />正しい値を入力してください。"); 
    95             SC_Response_Ex::actionExit(); 
     90            return false; 
    9691        } 
    9792         
     
    117112    { 
    118113        if (self::delivErrorCheck(array('customer_id' => $customer_id))) { 
    119             SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, "入力値が不正です。<br />正しい値を入力してください。"); 
    120             SC_Response_Ex::actionExit(); 
     114            return false; 
    121115        } 
    122116         
     
    141135     * @return void 
    142136     */ 
    143     public function deleteAddress($other_deliv_id) 
     137    public function deleteAddress($other_deliv_id, $customer_id = '') 
    144138    { 
    145         $objCustomer = new SC_Customer_Ex(); 
    146         $customer_id = $objCustomer->getValue('customer_id'); 
    147  
    148139        if (self::delivErrorCheck(array('customer_id' => $customer_id, 'other_deliv_id' => $other_deliv_id))) { 
    149             SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, "入力値が不正です。<br />正しい値を入力してください。"); 
    150             SC_Response_Ex::actionExit(); 
     140            return false; 
    151141        } 
    152142         
     
    156146        $where  = 'customer_id = ? AND other_deliv_id = ?'; 
    157147        $arrVal = array($customer_id, $other_deliv_id); 
    158         $objQuery->delete($from, $where, $arrVal); 
     148        return $objQuery->delete($from, $where, $arrVal); 
    159149    } 
    160150 
Note: See TracChangeset for help on using the changeset viewer.