Changeset 19864


Ignore:
Timestamp:
2011/01/11 16:06:42 (13 years ago)
Author:
fukuda
Message:

SC_Helper_DB内の顧客編集に関する部分は、SC_Helper_Customerを新規作成して
そちらで共通化するように変更

Location:
branches/version-2_5-dev/data
Files:
2 added
4 edited

Legend:

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

    r19807 r19864  
    311311            $arrRet = $objQuery->select("*", "dtb_order", $where, array($order_id)); 
    312312            $this->arrDisp = $arrRet[0]; 
    313             list($point) = SC_Helper_DB_Ex::sfGetCustomerPoint($order_id, $arrRet[0]['use_point'], $arrRet[0]['add_point']); 
     313            list($point) = SC_Helper_Customer_Ex::sfGetCustomerPoint($order_id, $arrRet[0]['use_point'], $arrRet[0]['add_point']); 
    314314            $this->arrDisp['point'] = $point; 
    315315 
     
    318318            $arrRet = SC_Utils_Ex::sfSwapArray($arrRet); 
    319319            $this->arrDisp = array_merge($this->arrDisp, $arrRet); 
    320             #$objFormParam->setParam($arrRet); 
    321320 
    322321            // その他支払い情報を表示 
  • branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php

    r19860 r19864  
    434434 
    435435    /** 
    436      * 会員編集登録処理を行う. 
    437      * 
    438      * @param array $array パラメータの配列 
    439      * @param array $arrRegistColumn 登録するカラムの配列 
    440      * @return void 
    441      */ 
    442     function sfEditCustomerData($array, $arrRegistColumn) { 
    443         $objQuery =& SC_Query::getSingletonInstance(); 
    444  
    445         foreach ($arrRegistColumn as $data) { 
    446             if ($data["column"] != "password") { 
    447                 if($array[ $data['column'] ] != "") { 
    448                     $arrRegist[ $data["column"] ] = $array[ $data["column"] ]; 
    449                 } else { 
    450                     $arrRegist[ $data['column'] ] = NULL; 
    451                 } 
    452             } 
    453         } 
    454         if (strlen($array["year"]) > 0 && strlen($array["month"]) > 0 && strlen($array["day"]) > 0) { 
    455             $arrRegist["birth"] = $array["year"] ."/". $array["month"] ."/". $array["day"] ." 00:00:00"; 
    456         } else { 
    457             $arrRegist["birth"] = NULL; 
    458         } 
    459  
    460         //-- パスワードの更新がある場合は暗号化。(更新がない場合はUPDATE文を構成しない) 
    461         if ($array["password"] != DEFAULT_PASSWORD) $arrRegist["password"] = sha1($array["password"] . ":" . AUTH_MAGIC); 
    462         $arrRegist["update_date"] = "NOW()"; 
    463  
    464         //-- 編集登録実行 
    465         $objQuery->update("dtb_customer", $arrRegist, "customer_id = ? ", array($array['customer_id'])); 
    466     } 
    467  
    468     /** 
    469436     * 受注番号、最終ポイント、加算ポイント、利用ポイントから「オーダー前ポイント」を取得する 
    470437     * 
     
    489456    } 
    490457     
    491     /** 
    492      * 注文番号、利用ポイント、加算ポイントから最終ポイントを取得する. 
    493      * 
    494      * @param integer $order_id 注文番号 
    495      * @param integer $use_point 利用ポイント 
    496      * @param integer $add_point 加算ポイント 
    497      * @return array 最終ポイントの配列 
    498      */ 
    499     function sfGetCustomerPoint($order_id, $use_point, $add_point) { 
    500         $objQuery =& SC_Query::getSingletonInstance(); 
    501         $arrRet = $objQuery->select("customer_id", "dtb_order", "order_id = ?", array($order_id)); 
    502         $customer_id = $arrRet[0]['customer_id']; 
    503         if ($customer_id != "" && $customer_id >= 1) { 
    504             if (USE_POINT !== false) { 
    505                 $arrRet = $objQuery->select("point", "dtb_customer", "customer_id = ?", array($customer_id)); 
    506                 $point = $arrRet[0]['point']; 
    507                 $total_point = $arrRet[0]['point'] - $use_point + $add_point; 
    508             } else { 
    509                 $total_point = 0; 
    510                 $point = 0; 
    511             } 
    512         } else { 
    513             $total_point = ""; 
    514             $point = ""; 
    515         } 
    516         return array($point, $total_point); 
    517     } 
    518  
    519     /** 
    520      * 顧客番号、利用ポイント、加算ポイントから最終ポイントを取得する. 
    521      * 
    522      * @param integer $customer_id 顧客番号 
    523      * @param integer $use_point 利用ポイント 
    524      * @param integer $add_point 加算ポイント 
    525      * @return array 最終ポイントの配列 
    526      */ 
    527     function sfGetCustomerPointFromCid($customer_id, $use_point, $add_point) { 
    528         $objQuery =& SC_Query::getSingletonInstance(); 
    529         if (USE_POINT !== false) { 
    530             $arrRet = $objQuery->select("point", "dtb_customer", "customer_id = ?", array($customer_id)); 
    531             $point = $arrRet[0]['point']; 
    532             $total_point = $arrRet[0]['point'] - $use_point + $add_point; 
    533         } else { 
    534             $total_point = 0; 
    535             $point = 0; 
    536         } 
    537         return array($point, $total_point); 
    538     } 
     458 
     459 
    539460    /** 
    540461     * カテゴリツリーの取得を行う. 
  • branches/version-2_5-dev/data/class/pages/admin/customer/LC_Page_Admin_Customer_Edit.php

    r19828 r19864  
    8181        $objDb = new SC_Helper_DB_Ex(); 
    8282        $objDate = new SC_Date(1901); 
     83        $objCustomerHelper = new SC_Helper_Customer_Ex(); 
    8384        $this->arrYear = $objDate->getYear();    // 日付プルダウン設定 
    8485        $this->arrMonth = $objDate->getMonth(); 
     
    201202                    } 
    202203                    //-- 編集登録 
    203                     $objDb->sfEditCustomerData($this->arrForm, $arrRegistColumn); 
     204                    $objCustomerHelper->sfEditCustomerData($this->arrForm, $arrRegistColumn); 
    204205                } 
    205206            } 
  • branches/version-2_5-dev/data/require_classes.php

    r19814 r19864  
    5959require_once(CLASS_EX_REALDIR . "helper_extends/SC_Helper_Purchase_Ex.php"); 
    6060require_once(CLASS_EX_REALDIR . "helper_extends/SC_Helper_Plugin_Ex.php"); 
     61require_once(CLASS_EX_REALDIR . "helper_extends/SC_Helper_Customer_Ex.php"); 
    6162?> 
Note: See TracChangeset for help on using the changeset viewer.