- Timestamp:
- 2012/11/04 07:02:38 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/helper/SC_Helper_Address.php
r22065 r22069 34 34 * お届け先を登録 35 35 * 36 * @param integer $customer_id37 36 * @param array $sqlval 38 * @param integer $other_deliv_id39 37 * @return array() 40 38 */ 41 function registAddress($customer_id, $sqlval, $other_deliv_id = '') {39 function save($sqlval) { 42 40 $objQuery =& SC_Query_Ex::getSingletonInstance(); 41 $customer_id = $sqlval['customer_id']; 42 $other_deliv_id = $sqlval['other_deliv_id']; 43 43 44 // 顧客IDのチェック 45 if (is_null($customer_id) || !is_numeric($customer_id) || !preg_match("/^\d+$/", $customer_id)) { 46 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '顧客IDを正しく指定して下さい。'); 47 } 44 48 // 追加 45 49 if (strlen($other_deliv_id == 0)) { … … 57 61 // 変更 58 62 } else { 59 $deliv_count = $objQuery->count('dtb_other_deliv',' customer_id = ? AND other_deliv_id = ?' ,array($customer_id,$other_deliv_id));63 $deliv_count = $objQuery->count('dtb_other_deliv','other_deliv_id = ?' ,array($other_deliv_id)); 60 64 if ($deliv_count != 1) { 61 65 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '一致する別のお届け先がありません。'); … … 70 74 * お届け先を取得 71 75 * 72 * @param integer $customer_id73 76 * @param integer $other_deliv_id 74 77 * @return array() 75 78 */ 76 function get Address($customer_id,$other_deliv_id) {79 function get($other_deliv_id) { 77 80 $objQuery =& SC_Query_Ex::getSingletonInstance(); 78 $address = $objQuery->select('*', 'dtb_other_deliv', ' customer_id = ? AND other_deliv_id = ?', array($customer_id,$other_deliv_id));81 $address = $objQuery->select('*', 'dtb_other_deliv', 'other_deliv_id = ?', array($other_deliv_id)); 79 82 return $address ? $address[0] : FALSE; 80 83 } … … 100 103 * お届け先の削除 101 104 * 102 * @param integer $customerId103 105 * @param integer $delivId 104 106 * @return void 105 107 */ 106 function delete Address($customer_id,$other_deliv_id) {107 $where = ' customer_id = ? ANDother_deliv_id = ?';108 function delete($other_deliv_id) { 109 $where = 'other_deliv_id = ?'; 108 110 $objQuery =& SC_Query_Ex::getSingletonInstance(); 109 $objQuery->delete('dtb_other_deliv', $where, array($ customer_id, $other_deliv_id));111 $objQuery->delete('dtb_other_deliv', $where, array($other_deliv_id)); 110 112 } 111 113
Note: See TracChangeset
for help on using the changeset viewer.
