Changeset 15567


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

リファクタリング

  • DB インスタンスを生成する関数を移動.
Location:
branches/feature-module-update/data/class
Files:
2 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     * 
  • branches/feature-module-update/data/class/util/SC_Utils.php

    r15548 r15567  
    16841684    } 
    16851685 
    1686     //会員編集登録処理 
    1687     function sfEditCustomerData($array, $arrRegistColumn) { 
    1688         $objQuery = new SC_Query(); 
    1689  
    1690         foreach ($arrRegistColumn as $data) { 
    1691             if ($data["column"] != "password") { 
    1692                 if($array[ $data['column'] ] != "") { 
    1693                     $arrRegist[ $data["column"] ] = $array[ $data["column"] ]; 
    1694                 } else { 
    1695                     $arrRegist[ $data['column'] ] = NULL; 
    1696                 } 
    1697             } 
    1698         } 
    1699         if (strlen($array["year"]) > 0 && strlen($array["month"]) > 0 && strlen($array["day"]) > 0) { 
    1700             $arrRegist["birth"] = $array["year"] ."/". $array["month"] ."/". $array["day"] ." 00:00:00"; 
    1701         } else { 
    1702             $arrRegist["birth"] = NULL; 
    1703         } 
    1704  
    1705         //-- パスワードの更新がある場合は暗号化。(更新がない場合はUPDATE文を構成しない) 
    1706         if ($array["password"] != DEFAULT_PASSWORD) $arrRegist["password"] = sha1($array["password"] . ":" . AUTH_MAGIC); 
    1707         $arrRegist["update_date"] = "NOW()"; 
    1708  
    1709         //-- 編集登録実行 
    1710         if (defined('MOBILE_SITE')) { 
    1711             $arrRegist['email_mobile'] = $arrRegist['email']; 
    1712             unset($arrRegist['email']); 
    1713         } 
    1714         $objQuery->begin(); 
    1715         $objQuery->update("dtb_customer", $arrRegist, "customer_id = ? ", array($array['customer_id'])); 
    1716         $objQuery->commit(); 
    1717     } 
    1718  
    17191686    // PHPのmb_convert_encoding関数をSmartyでも使えるようにする 
    17201687    function sf_mb_convert_encoding($str, $encode = 'CHAR_CODE') { 
Note: See TracChangeset for help on using the changeset viewer.