Changeset 22065 for branches/version-2_12-dev/data/class/pages/shopping
- Timestamp:
- 2012/11/02 19:27:41 (11 years ago)
- Location:
- branches/version-2_12-dev/data/class/pages/shopping
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/pages/shopping/LC_Page_Shopping_Deliv.php
r21951 r22065 73 73 $objPurchase = new SC_Helper_Purchase_Ex(); 74 74 $objFormParam = new SC_FormParam_Ex(); 75 $objAddress = new SC_Helper_Address_Ex(); 75 76 76 77 $this->tpl_uniqid = $objSiteSess->getUniqId(); … … 109 110 // 削除 110 111 case 'delete': 111 $ this->doDelete($arrForm['other_deliv_id']);112 $objAddress->deleteAddress($objCustomer->getValue('customer_id'), $arrForm['other_deliv_id']); 112 113 break; 113 114 … … 117 118 118 119 $shipping_id = $arrForm['deliv_check'] == -1 ? 0 : $arrForm['deliv_check']; 119 $success = $this->registerDeliv($shipping_id, $this->tpl_uniqid, $objPurchase, $objCustomer );120 $success = $this->registerDeliv($shipping_id, $this->tpl_uniqid, $objPurchase, $objCustomer, $objAddress); 120 121 if (!$success) { 121 122 SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); … … 161 162 162 163 // 登録済み住所を取得 163 $this->arrAddr = $objCustomer->getCustomerAddress($objCustomer->getValue('customer_id')); 164 $addr = array( 165 array( 166 'other_deliv_id' => NULL, 167 'customer_id' => $objCustomer->getValue('customer_id'), 168 'name01' => $objCustomer->getValue('name01'), 169 'name02' => $objCustomer->getValue('name02'), 170 'kana01' => $objCustomer->getValue('kana01'), 171 'kana02' => $objCustomer->getValue('kana02'), 172 'zip01' => $objCustomer->getValue('zip01'), 173 'zip02' => $objCustomer->getValue('zip02'), 174 'pref' => $objCustomer->getValue('pref'), 175 'addr01' => $objCustomer->getValue('addr01'), 176 'addr02' => $objCustomer->getValue('addr02'), 177 'tel01' => $objCustomer->getValue('tel01'), 178 'tel02' => $objCustomer->getValue('tel02'), 179 'tel03' => $objCustomer->getValue('tel03'), 180 ) 181 ); 182 $this->arrAddr = array_merge($addr, $objAddress->getList($objCustomer->getValue('customer_id'))); 164 183 $this->tpl_addrmax = count($this->arrAddr); 165 184 … … 185 204 $objFormParam->addParam('その他のお届け先ID', 'other_deliv_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 186 205 $objFormParam->addParam('お届け先チェック', 'deliv_check', INT_LEN, 'n', array('MAX_LENGTH_CHECK')); 187 }188 189 /**190 * その他のお届け先情報を削除する.191 *192 * @param integer $other_deliv_id その他のお届け先ID193 * @return void194 */195 function doDelete($other_deliv_id) {196 $objQuery =& SC_Query_Ex::getSingletonInstance();197 $where = 'other_deliv_id = ?';198 $objQuery->delete('dtb_other_deliv', $where, array($other_deliv_id));199 206 } 200 207 … … 212 219 * @return boolean お届け先チェックの値が妥当な場合 true 213 220 */ 214 function registerDeliv($other_deliv_id, $uniqid, &$objPurchase, &$objCustomer ) {221 function registerDeliv($other_deliv_id, $uniqid, &$objPurchase, &$objCustomer, $objAddress) { 215 222 GC_Utils_Ex::gfDebugLog('register deliv. deliv_check=' . $deliv_check); 216 223 $arrValues = array(); … … 221 228 // 別のお届け先がチェックされている場合 222 229 else { 223 $objQuery =& SC_Query_Ex::getSingletonInstance(); 224 $arrOtherDeliv = $objQuery->getRow('*', 'dtb_other_deliv', 225 'customer_id = ? AND other_deliv_id = ?', 226 array($objCustomer->getValue('customer_id'), $other_deliv_id)); 227 if (empty($arrOtherDeliv)) { 230 $arrOtherDeliv = $objAddress->getAddress($objCustomer->getValue('customer_id'), $other_deliv_id); 231 if (!$arrOtherDeliv) { 228 232 return false; 229 233 } -
branches/version-2_12-dev/data/class/pages/shopping/LC_Page_Shopping_Multiple.php
r21951 r22065 71 71 $objCustomer = new SC_Customer_Ex(); 72 72 $objFormParam = new SC_FormParam_Ex(); 73 $objAddress = new SC_Helper_Address_Ex(); 73 74 74 75 // 複数配送先指定が無効な場合はエラー … … 81 82 82 83 $this->addrs = $this->getDelivAddrs($objCustomer, $objPurchase, 83 $ this->tpl_uniqid);84 $objAddress, $this->tpl_uniqid); 84 85 $this->tpl_addrmax = count($this->addrs); 85 86 $this->lfInitParam($objFormParam); … … 96 97 $this->saveMultipleShippings($this->tpl_uniqid, $objFormParam, 97 98 $objCustomer, $objPurchase, 98 $objCartSess );99 $objCartSess, $objAddress); 99 100 $objSiteSess->setRegistFlag(); 100 101 … … 187 188 * @return array 配送住所のプルダウン用連想配列 188 189 */ 189 function getDelivAddrs(&$objCustomer, &$objPurchase, $uniqid) {190 function getDelivAddrs(&$objCustomer, &$objPurchase, &$objAddress, $uniqid) { 190 191 $masterData = new SC_DB_MasterData_Ex(); 191 192 $arrPref = $masterData->getMasterData('mtb_pref'); … … 194 195 // 会員ログイン時 195 196 if ($objCustomer->isLoginSuccess(true)) { 196 $arrAddrs = $objCustomer->getCustomerAddress($objCustomer->getValue('customer_id')); 197 $addr = array( 198 array( 199 'other_deliv_id' => NULL, 200 'customer_id' => $objCustomer->getValue('customer_id'), 201 'name01' => $objCustomer->getValue('name01'), 202 'name02' => $objCustomer->getValue('name02'), 203 'kana01' => $objCustomer->getValue('kana01'), 204 'kana02' => $objCustomer->getValue('kana02'), 205 'zip01' => $objCustomer->getValue('zip01'), 206 'zip02' => $objCustomer->getValue('zip02'), 207 'pref' => $objCustomer->getValue('pref'), 208 'addr01' => $objCustomer->getValue('addr01'), 209 'addr02' => $objCustomer->getValue('addr02'), 210 'tel01' => $objCustomer->getValue('tel01'), 211 'tel02' => $objCustomer->getValue('tel02'), 212 'tel03' => $objCustomer->getValue('tel03'), 213 ) 214 ); 215 $arrAddrs = array_merge($addr, $objAddress->getList($objCustomer->getValue('customer_id'))); 197 216 foreach ($arrAddrs as $val) { 198 217 $other_deliv_id = SC_Utils_Ex::isBlank($val['other_deliv_id']) ? 0 : $val['other_deliv_id']; … … 280 299 * @return void 281 300 */ 282 function saveMultipleShippings($uniqid, &$objFormParam, &$objCustomer, &$objPurchase, &$objCartSess ) {301 function saveMultipleShippings($uniqid, &$objFormParam, &$objCustomer, &$objPurchase, &$objCartSess, &$objAddress) { 283 302 $objQuery =& SC_Query_Ex::getSingletonInstance(); 284 303 … … 290 309 if ($objCustomer->isLoginSuccess(true)) { 291 310 if ($other_deliv_id != 0) { 292 $otherDeliv = $objQuery->select('*', 'dtb_other_deliv', 293 'other_deliv_id = ?', 294 array($other_deliv_id)); 295 foreach ($otherDeliv[0] as $key => $val) { 311 $otherDeliv = $objAddress->getAddress($objCustomer->getValue('customer_id'), $other_deliv_id); 312 foreach ($otherDeliv as $key => $val) { 296 313 $arrValues[$other_deliv_id]['shipping_' . $key] = $val; 297 314 }
Note: See TracChangeset
for help on using the changeset viewer.