Ignore:
Timestamp:
2007/09/03 19:57:15 (17 years ago)
Author:
nanasess
Message:

リファクタリング

  • DB インスタンスを生成する関数を移動.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/helper/SC_Helper_DB.php

    r15548 r15567  
    424424 
    425425    /** 
     426     * 会員編集登録処理を行う. 
     427     * 
     428     * @param array $array パラメータの配列 
     429     * @param array $arrRegistColumn 登録するカラムの配列 
     430     * @return void 
     431     */ 
     432    function sfEditCustomerData($array, $arrRegistColumn) { 
     433        $objQuery = new SC_Query(); 
     434 
     435        foreach ($arrRegistColumn as $data) { 
     436            if ($data["column"] != "password") { 
     437                if($array[ $data['column'] ] != "") { 
     438                    $arrRegist[ $data["column"] ] = $array[ $data["column"] ]; 
     439                } else { 
     440                    $arrRegist[ $data['column'] ] = NULL; 
     441                } 
     442            } 
     443        } 
     444        if (strlen($array["year"]) > 0 && strlen($array["month"]) > 0 && strlen($array["day"]) > 0) { 
     445            $arrRegist["birth"] = $array["year"] ."/". $array["month"] ."/". $array["day"] ." 00:00:00"; 
     446        } else { 
     447            $arrRegist["birth"] = NULL; 
     448        } 
     449 
     450        //-- パスワードの更新がある場合は暗号化。(更新がない場合はUPDATE文を構成しない) 
     451        if ($array["password"] != DEFAULT_PASSWORD) $arrRegist["password"] = sha1($array["password"] . ":" . AUTH_MAGIC); 
     452        $arrRegist["update_date"] = "NOW()"; 
     453 
     454        //-- 編集登録実行 
     455        if (defined('MOBILE_SITE')) { 
     456            $arrRegist['email_mobile'] = $arrRegist['email']; 
     457            unset($arrRegist['email']); 
     458        } 
     459        $objQuery->begin(); 
     460        $objQuery->update("dtb_customer", $arrRegist, "customer_id = ? ", array($array['customer_id'])); 
     461        $objQuery->commit(); 
     462    } 
     463 
     464    /** 
    426465     * カテゴリツリーの取得を行う. 
    427466     * 
Note: See TracChangeset for help on using the changeset viewer.