Ignore:
Timestamp:
2013/05/02 18:11:36 (11 years ago)
Author:
h_yoshimoto
Message:

#2236 2.12.3リリース以降の2.12-devへのコミット差し戻し

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/helper/SC_Helper_Payment.php

    r22568 r22796  
    3535     *  
    3636     * @param integer $payment_id 支払方法ID 
    37      * @param boolean $has_deleted 削除された支払方法も含む場合 true; 初期値 false 
    3837     * @return array 
    3938     */ 
    40     public function get($payment_id, $has_deleted = false) 
    41     { 
     39    public function get($payment_id) { 
    4240        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    4341        $where = 'payment_id = ?'; 
    44         if (!$has_deleted) { 
    45             $where .= ' AND del_flg = 0'; 
    46         } 
    4742        $arrRet = $objQuery->select('*', 'dtb_payment', $where, array($payment_id)); 
    4843        return $arrRet[0]; 
     
    5247     * 支払方法一覧の取得. 
    5348     * 
    54      * @param boolean $has_deleted 削除された支払方法も含む場合 true; 初期値 false 
    5549     * @return array 
    5650     */ 
    57     public function getList($has_deleted = false) 
    58     { 
     51    public function getList() { 
    5952        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    60         $col = 'payment_id, payment_method, payment_image, charge, rule_max, upper_rule, note, fix, charge_flg'; 
    61         $where = ''; 
    62         if (!$has_deleted) { 
    63             $where .= 'del_flg = 0'; 
    64         } 
     53        $col = 'payment_id, payment_method, charge, rule_max, upper_rule, note, fix, charge_flg'; 
     54        $where = 'del_flg = 0'; 
    6555        $table = 'dtb_payment'; 
    6656        $objQuery->setOrder('rank DESC'); 
    6757        $arrRet = $objQuery->select($col, $table, $where); 
    6858        return $arrRet; 
    69     } 
    70  
    71     /** 
    72      * 購入金額に応じた支払方法を取得する. 
    73      * 
    74      * @param integer $total 購入金額 
    75      * @return array 購入金額に応じた支払方法の配列 
    76      */ 
    77     function getByPrice($total) 
    78     { 
    79         // 削除されていない支払方法を取得 
    80         $payments = $this->getList(); 
    81         $arrPayment = array(); 
    82         foreach ($payments as $data) { 
    83             // 下限と上限が設定されている 
    84             if (strlen($data['rule_max']) != 0 && strlen($data['upper_rule']) != 0) { 
    85                 if ($data['rule_max'] <= $total && $data['upper_rule'] >= $total) { 
    86                     $arrPayment[] = $data; 
    87                 } 
    88             } 
    89             // 下限のみ設定されている 
    90             elseif (strlen($data['rule_max']) != 0) { 
    91                 if ($data['rule_max'] <= $total) { 
    92                     $arrPayment[] = $data; 
    93                 } 
    94             } 
    95             // 上限のみ設定されている 
    96             elseif (strlen($data['upper_rule']) != 0) { 
    97                 if ($data['upper_rule'] >= $total) { 
    98                     $arrPayment[] = $data; 
    99                 } 
    100             } 
    101             // いずれも設定なし 
    102             else { 
    103                 $arrPayment[] = $data; 
    104             } 
    105         } 
    106         return $arrPayment; 
    10759    } 
    10860 
     
    11365     * @return void 
    11466     */ 
    115     public function save($sqlval) 
    116     { 
     67    public function save($sqlval) { 
     68        $payment_id = $sqlval['payment_id']; 
     69 
    11770        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    118  
    119         $payment_id = $sqlval['payment_id']; 
    120         $sqlval['update_date'] = 'CURRENT_TIMESTAMP'; 
    12171        // 新規登録 
    12272        if ($payment_id == '') { 
     
    12979        } else { 
    13080            unset($sqlval['creator_id']); 
    131             unset($sqlval['create_date']); 
    13281            $where = 'payment_id = ?'; 
    13382            $objQuery->update('dtb_payment', $sqlval, $where, array($payment_id)); 
     
    14190     * @return void 
    14291     */ 
    143     public function delete($payment_id) 
    144     { 
     92    public function delete($payment_id) { 
    14593        $objDb = new SC_Helper_DB_Ex(); 
    14694        // ランク付きレコードの削除 
     
    154102     * @return void 
    155103     */ 
    156     public function rankUp($payment_id) 
    157     { 
     104    public function rankUp($payment_id) { 
    158105        $objDb = new SC_Helper_DB_Ex(); 
    159106        $objDb->sfRankUp('dtb_payment', 'payment_id', $payment_id); 
     
    166113     * @return void 
    167114     */ 
    168     public function rankDown($payment_id) 
    169     { 
     115    public function rankDown($payment_id) { 
    170116        $objDb = new SC_Helper_DB_Ex(); 
    171117        $objDb->sfRankDown('dtb_payment', 'payment_id', $payment_id); 
     
    180126     * @return boolean 決済モジュールを使用する支払い方法の場合 true 
    181127     */ 
    182     public static function useModule($payment_id) 
    183     { 
     128    public static function useModule($payment_id) { 
    184129        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    185130        $memo03 = $objQuery->get('memo03', 'dtb_payment', 'payment_id = ?', array($payment_id)); 
    186131        return !SC_Utils_Ex::isBlank($memo03); 
    187132    } 
    188  
    189     /** 
    190      * 支払方法IDをキー, 名前を値とする配列を取得. 
    191      *  
    192      * @return array 
    193      */ 
    194     public static function getIDValueList() 
    195     { 
    196         return SC_Helper_DB_Ex::sfGetIDValueList('dtb_payment', 'payment_id', 'payment_method'); 
    197     } 
    198133} 
Note: See TracChangeset for help on using the changeset viewer.