Ignore:
Timestamp:
2011/02/03 18:26:30 (13 years ago)
Author:
kimoto
Message:

会員登録リファクタリング #979

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/helper/SC_Helper_Customer.php

    r19995 r20074  
    3131 */ 
    3232class SC_Helper_Customer { 
    33      
    34      
     33 
     34 
    3535    /** 
    3636     * 会員編集登録処理を行う. 
     
    3939     * @param array $arrRegistColumn 登録するカラムの配列 
    4040     * @return void 
    41      * @deprecated  
     41     * @deprecated 
    4242     * @todo sfEditCustomerData に統一。LC_Page_Admin_Customer_Edit から呼び出されているだけ 
    4343     */ 
     
    7373            $arrRegist["reminder_answer"] = SC_Utils_Ex::sfGetHashString($array["reminder_answer"], $salt); 
    7474        } 
    75          
     75 
    7676        $arrRegist["update_date"] = "NOW()"; 
    77          
     77 
    7878        //-- 編集登録実行 
    7979        $objQuery->update("dtb_customer", $arrRegist, "customer_id = ? ", array($array['customer_id'])); 
    8080    } 
    81      
     81 
    8282    /** 
    8383     * 会員編集登録処理を行う. 
     
    9292 
    9393        $array["update_date"] = "now()";    // 更新日 
    94          
     94 
    9595        // salt値の生成(insert時)または取得(update時)。 
    9696        if(is_numeric($customer_id)) { 
     
    121121        } else { 
    122122            // 新規登録 
    123              
     123 
    124124            // 会員ID 
    125125            $customer_id = $objQuery->nextVal('dtb_customer_customer_id'); 
     
    129129            // 作成日 
    130130            if (is_null($array["create_date"])){ 
    131                 $array["create_date"] = "now()";     
    132             }             
     131                $array["create_date"] = "now()"; 
     132            } 
    133133            $objQuery->insert("dtb_customer", $array); 
    134134        } 
    135135        return $customer_id; 
    136136    } 
    137          
     137 
    138138    /** 
    139139     * 注文番号、利用ポイント、加算ポイントから最終ポイントを取得する. 
     
    163163        return array($point, $total_point); 
    164164    } 
    165      
     165 
    166166    /** 
    167167     *   emailアドレスから、登録済み会員や退会済み会員をチェックする 
    168      *    
     168     * 
    169169     *   @param string $email  メールアドレス 
    170170     *   @return integer  0:登録可能     1:登録済み   2:再登録制限期間内削除ユーザー  3:自分のアドレス 
     
    172172    function sfCheckRegisterUserFromEmail($email){ 
    173173        $return = 0; 
    174          
     174 
    175175        $objCustomer = new SC_Customer(); 
    176176        $objQuery =& SC_Query::getSingletonInstance(); 
    177          
     177 
    178178        $arrRet = $objQuery->select("email, update_date, del_flg" 
    179179                                    ,"dtb_customer" 
     
    200200            } 
    201201        } 
    202          
     202 
    203203        // ログインしている場合、すでに登録している自分のemailの場合はエラーを返さない 
    204204        if ($objCustomer->getValue('customer_id')){ 
     
    208208                            ,array($objCustomer->getValue('customer_id')) 
    209209                            ); 
    210             if ($email == $arrRet[0]["email"]  
     210            if ($email == $arrRet[0]["email"] 
    211211                || $email == $arrRet[0]["email_mobile"]){ 
    212212                    $return = 3; 
     
    215215        return $return; 
    216216    } 
     217 
     218 
     219    /** 
     220     * sfGetUniqSecretKey 
     221     * 
     222     * 重複しない会員登録キーを発行する。 
     223     * 
     224     * @access public 
     225     * @return void 
     226     */ 
     227    function sfGetUniqSecretKey() { 
     228        $objQuery   = new SC_Query(); 
     229        $count      = 1; 
     230        while ($count != 0) { 
     231            $uniqid = SC_Utils_Ex::sfGetUniqRandomId("r"); 
     232            $count  = $objQuery->count("dtb_customer", "secret_key = ?", array($uniqid)); 
     233        } 
     234        return $uniqid; 
     235    } 
    217236} 
Note: See TracChangeset for help on using the changeset viewer.