- Timestamp:
- 2013/02/18 19:43:15 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/helper/SC_Helper_Payment.php
r22567 r22568 58 58 { 59 59 $objQuery =& SC_Query_Ex::getSingletonInstance(); 60 $col = 'payment_id, payment_method, charge, rule_max, upper_rule, note, fix, charge_flg';60 $col = 'payment_id, payment_method, payment_image, charge, rule_max, upper_rule, note, fix, charge_flg'; 61 61 $where = ''; 62 62 if (!$has_deleted) { … … 67 67 $arrRet = $objQuery->select($col, $table, $where); 68 68 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; 69 107 } 70 108
Note: See TracChangeset
for help on using the changeset viewer.
