Ignore:
Timestamp:
2013/02/18 19:43:15 (13 years ago)
Author:
pineray
Message:

#2134 支払い方法に関する処理を SC_Helper_Payment へ集約.

File:
1 edited

Legend:

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

    r22567 r22568  
    540540        } 
    541541        return SC_Utils_Ex::sfArrayIntersectKeys($arrSrc, $arrKey); 
    542     } 
    543  
    544     /** 
    545      * 購入金額に応じた支払方法を取得する. 
    546      * 
    547      * @param integer $total 購入金額 
    548      * @param integer $deliv_id 配送業者ID 
    549      * @return array 購入金額に応じた支払方法の配列 
    550      */ 
    551     function getPaymentsByPrice($total, $deliv_id) 
    552     { 
    553  
    554         $arrPaymentIds = SC_Helper_Delivery_Ex::getPayments($deliv_id); 
    555         if (SC_Utils_Ex::isBlank($arrPaymentIds)) { 
    556             return array(); 
    557         } 
    558  
    559         $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    560  
    561         // 削除されていない支払方法を取得 
    562         $where = 'del_flg = 0 AND payment_id IN (' . SC_Utils_Ex::repeatStrWithSeparator('?', count($arrPaymentIds)) . ')'; 
    563         $objQuery->setOrder('rank DESC'); 
    564         $payments = $objQuery->select('payment_id, payment_method, rule_max, upper_rule, note, payment_image, charge', 'dtb_payment', $where, $arrPaymentIds); 
    565         $arrPayment = array(); 
    566         foreach ($payments as $data) { 
    567             // 下限と上限が設定されている 
    568             if (strlen($data['rule_max']) != 0 && strlen($data['upper_rule']) != 0) { 
    569                 if ($data['rule_max'] <= $total && $data['upper_rule'] >= $total) { 
    570                     $arrPayment[] = $data; 
    571                 } 
    572             } 
    573             // 下限のみ設定されている 
    574             elseif (strlen($data['rule_max']) != 0) { 
    575                 if ($data['rule_max'] <= $total) { 
    576                     $arrPayment[] = $data; 
    577                 } 
    578             } 
    579             // 上限のみ設定されている 
    580             elseif (strlen($data['upper_rule']) != 0) { 
    581                 if ($data['upper_rule'] >= $total) { 
    582                     $arrPayment[] = $data; 
    583                 } 
    584             } 
    585             // いずれも設定なし 
    586             else { 
    587                 $arrPayment[] = $data; 
    588             } 
    589         } 
    590         return $arrPayment; 
    591542    } 
    592543 
Note: See TracChangeset for help on using the changeset viewer.