Changeset 19861 for branches/version-2_5-dev/data
- Timestamp:
- 2011/01/10 16:57:29 (13 years ago)
- bzr:base-revision:
- nanasess@fsm.ne.jp-20110110045915-6b02oxleldtyw7ee
- bzr:committer:
- Kentaro Ohkouchi <nanasess@fsm.ne.jp>
- bzr:file-ids:
data/class/helper/SC_Helper_Purchase.php sc_helper_purchase.p-20101020100530-jyaoa7ch9pdfjqzp-1
data/class/pages/shopping/LC_Page_Shopping.php 15223@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fshopping%2FLC_Page_Shopping.php
data/class/pages/shopping/LC_Page_Shopping_Confirm.php 15223@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fshopping%2FLC_Page_Shopping_Confirm.php
data/class/pages/shopping/LC_Page_Shopping_Deliv.php 15223@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fshopping%2FLC_Page_Shopping_Deliv.php
data/class/pages/shopping/LC_Page_Shopping_Payment.php 15223@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fshopping%2FLC_Page_Shopping_Payment.php
html/install/sql/create_table_mysql.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Fcreate_table_mysql.sql
html/install/sql/create_table_pgsql.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Fcreate_table_pgsql.sql- bzr:mapping-version:
- v4
- bzr:merge:
nanasess@fsm.ne.jp-20110110075529-5iceg1qu15cmyr60- bzr:repository-uuid:
- 1e3b908f-19a9-db11-a64c-001125224ba8
- bzr:revision-id:
- nanasess@fsm.ne.jp-20110110075706-tq0uswsfrsetr0rq
- bzr:revno:
- 2590
- bzr:revprop:branch-nick:
- branches/version-2_5-dev
- bzr:root:
- branches/version-2_5-dev
- bzr:text-revisions:
data/class/helper/SC_Helper_Purchase.php nanasess@fsm.ne.jp-20110110075529-5iceg1qu15cmyr60
data/class/pages/shopping/LC_Page_Shopping.php nanasess@fsm.ne.jp-20110110075529-5iceg1qu15cmyr60
data/class/pages/shopping/LC_Page_Shopping_Confirm.php nanasess@fsm.ne.jp-20110110075529-5iceg1qu15cmyr60
data/class/pages/shopping/LC_Page_Shopping_Deliv.php nanasess@fsm.ne.jp-20110110075529-5iceg1qu15cmyr60
data/class/pages/shopping/LC_Page_Shopping_Payment.php nanasess@fsm.ne.jp-20110110075529-5iceg1qu15cmyr60
html/install/sql/create_table_mysql.sql nanasess@fsm.ne.jp-20110110075529-5iceg1qu15cmyr60
html/install/sql/create_table_pgsql.sql nanasess@fsm.ne.jp-20110110075529-5iceg1qu15cmyr60- bzr:timestamp:
- 2011-01-10 16:57:06.664000034 +0900
- bzr:user-agent:
- bzr2.2.2+bzr-svn1.0.4
- svn:original-date:
- 2011-01-10T07:57:06.664000Z
- Location:
- branches/version-2_5-dev/data/class
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/helper/SC_Helper_Purchase.php
r19860 r19861 71 71 $orderTemp['status'] = $orderStatus; 72 72 $orderId = $this->registerOrder($orderTemp, $objCartSession, 73 $_SESSION['cartKey']); 73 $objCartSession->getKey()); 74 $this->registerShipping($orderId, $this->getShippingTemp()); 74 75 $objQuery->commit(); 75 76 $objCustomer->updateSession(); … … 172 173 173 174 /** 175 * セッションの配送情報を取得する. 176 */ 177 function getShippingTemp() { 178 return $_SESSION['shipping']; 179 } 180 181 /** 174 182 * 配送情報をセッションに保存する. 175 183 */ … … 188 196 189 197 /** 198 * セッションの配送情報を破棄する. 199 */ 200 function unsetShippingTemp() { 201 unset($_SESSION['shipping']); 202 } 203 204 /** 190 205 * 会員情報を受注情報にコピーする. 191 206 * … … 196 211 * @param array $dest コピー先の配列 197 212 * @param SC_Customer $objCustomer SC_Customer インスタンス 213 * @param string $prefix コピー先の接頭辞. デフォルト order 198 214 * @param array $keys コピー対象のキー 199 * @param string $prefix コピー先の接頭辞. デフォルト order200 215 * @return void 201 216 */ 202 function copyFromCustomer(&$dest, &$objCustomer, 217 function copyFromCustomer(&$dest, &$objCustomer, $prefix = 'order', 203 218 $keys = array('name01', 'name02', 'kana01', 'kana02', 204 219 'sex', 'zip01', 'zip02', 'pref', 205 220 'addr01', 'addr02', 206 221 'tel01', 'tel02', 'tel03', 'job', 207 'birth', 'email'), 208 $prefix = 'order') { 222 'birth', 'email')) { 209 223 if ($objCustomer->isLoginSuccess(true)) { 210 224 … … 329 343 } 330 344 return $arrDelivTime; 345 } 346 347 /** 348 * 商品種別ID から配送業者ID を取得する. 349 */ 350 function getDeliv($productTypeId) { 351 $objQuery =& SC_Query::getSingletonInstance(); 352 return $objQuery->get("deliv_id", "dtb_deliv", "product_type_id = ?", 353 array($productTypeId)); 354 } 355 356 /** 357 * 配送情報を登録する. 358 */ 359 function registerShipping($orderId, $params) { 360 $objQuery =& SC_Query::getSingletonInstance(); 361 362 $cols = $objQuery->listTableFields('dtb_shipping'); 363 364 foreach ($params as $shipping_id => $shipping_val) { 365 // 存在するカラムのみ INSERT 366 foreach ($shipping_val as $key => $val) { 367 if (in_array($key, $cols)) { 368 $sqlval[$key] = $val; 369 } 370 } 371 372 $sqlval['order_id'] = $orderId; 373 $sqlval['shipping_id'] = $shipping_id; 374 $sqlval['create_date'] = 'Now()'; 375 $sqlval['update_date'] = 'Now()'; 376 $objQuery->insert("dtb_shipping", $sqlval); 377 } 331 378 } 332 379 -
branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping.php
r19860 r19861 141 141 if(count($this->arrErr) == 0) { 142 142 // DBへのデータ登録 143 $this->lfRegistData($uniqid, $objPurchase, $objCustomer );143 $this->lfRegistData($uniqid, $objPurchase, $objCustomer, $this->cartKey); 144 144 // 正常に登録されたことを記録しておく 145 145 $objSiteSess->setRegistFlag(); … … 163 163 if(count($this->arrErr) == 0) { 164 164 // DBへのデータ登録 165 $this->lfRegistData($uniqid, $objPurchase, $objCustomer );165 $this->lfRegistData($uniqid, $objPurchase, $objCustomer, $this->cartKey); 166 166 // 正常に登録されたことを記録しておく 167 167 $objSiteSess->setRegistFlag(); … … 337 337 338 338 /* DBへデータの登録 */ 339 function lfRegistData($uniqid, &$objPurchase, &$objCustomer ) {339 function lfRegistData($uniqid, &$objPurchase, &$objCustomer, $productTypeId) { 340 340 $params = $this->objFormParam->getHashArray(); 341 341 $sqlval = $this->objFormParam->getDbArray(); … … 344 344 $sqlval['update_date'] = 'Now()'; 345 345 $sqlval['customer_id'] = '0'; 346 $sqlval['deliv_id'] = $objPurchase->getDeliv($productTypeId); 346 347 347 348 // お届け先を指定しない場合、 348 if ($ sqlval['deliv_check'] != '1') {349 if ($params['deliv_check'] != '1') { 349 350 // order_* を shipping_* へコピー 350 351 $objPurchase->copyFromOrder($sqlval, $params); -
branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Confirm.php
r19860 r19861 77 77 $objQuery = new SC_Query(); 78 78 $objDb = new SC_Helper_DB_Ex(); 79 $objPurchase = new SC_Helper_Purchase_Ex(); 79 80 80 81 // 前のページで正しく登録手続きが行われた記録があるか判定 … … 82 83 83 84 // ユーザユニークIDの取得と購入状態の正当性をチェック 84 $uniqid = SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess); 85 $uniqid = $objSiteSess->getUniqId(); 86 $objPurchase->verifyChangeCart($uniqid, $objCartSess); 85 87 $this->tpl_uniqid = $uniqid; 86 88 87 //ダウンロード商品判定 88 $this->cartdown = $objDb->chkCartDown($objCartSess); 89 90 91 $this->cartKey = $_SESSION['cartKey']; 89 $this->cartKey = $objCartSess->getKey(); 92 90 93 91 // カート内商品のチェック … … 108 106 // TODO リファクタリング 109 107 // 一時受注テーブルの読込 110 $tmpData = $obj Db->sfGetOrderTemp($uniqid);108 $tmpData = $objPurchase->getOrderTemp($uniqid); 111 109 112 110 // カート集計を元に最終計算 … … 144 142 $arrData["order_id"] = $objQuery->nextval("dtb_order_order_id"); 145 143 146 // セッション情報を保持147 $arrData['session'] = serialize($_SESSION);148 149 144 // 集計結果を受注一時テーブルに反映 150 145 unset($arrData[0]); // FIXME 151 146 unset($arrData[1]); 152 $obj Db->sfRegistTempOrder($uniqid, $arrData);147 $objPurchase->saveOrderTemp($uniqid, $arrData, $objCustomer); 153 148 // 正常に登録されたことを記録しておく 154 149 $objSiteSess->setRegistFlag(); … … 157 152 if($payment_type != "") { 158 153 $_SESSION["payment_id"] = $arrData['payment_id']; 159 $objPurchase = new SC_Helper_Purchase_Ex(); 154 160 155 $objPurchase->completeOrder(ORDER_PENDING); 161 156 $this->objDisplay->redirect($this->getLocation(SHOPPING_MODULE_URL_PATH)); 162 157 }else{ 163 158 // 受注を完了し, 購入完了ページへ 164 $objPurchase = new SC_Helper_Purchase_Ex();165 159 $objPurchase->completeOrder(ORDER_NEW); 166 160 $objPurchase->sendOrderMail($arrData["order_id"]); -
branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Deliv.php
r19860 r19861 79 79 $objCustomer = new SC_Customer(); 80 80 $objDb = new SC_Helper_DB_Ex(); 81 $objPurchase = new SC_Helper_Purchase_Ex(); 81 82 // クッキー管理クラス 82 83 $objCookie = new SC_Cookie(COOKIE_EXPIRE); … … 99 100 $this->tpl_uniqid = $uniqid; 100 101 101 //ダウンロード商品判定 102 $this->cartdown = $objDb->chkCartDown($objCartSess); 102 $this->cartKey = $objCartSess->getKey(); 103 103 104 104 if (!isset($_POST['mode'])) $_POST['mode'] = ""; … … 139 139 } 140 140 //ダウンロード商品判定 141 if($this->cart down==2){141 if($this->cartKey == PRODUCT_TYPE_DOWNLOAD){ 142 142 // 会員情報の住所を受注一時テーブルに書き込む 143 143 $objDb->sfRegistDelivData($uniqid, $objCustomer); … … 160 160 // 会員登録住所に送る 161 161 case 'customer_addr': 162 $sqlval = array(); 162 163 // 会員登録住所がチェックされている場合 163 164 if ($_POST['deliv_check'] == '-1') { 164 165 // 会員情報の住所を受注一時テーブルに書き込む 165 $this->lfRegistDelivData($uniqid, $objCustomer); 166 $objPurchase->copyFromCustomer($sqlval, $objCustomer, 'shipping'); 167 $sqlval['deliv_id'] = $objPurchase->getDeliv($this->cartKey); 168 $objPurchase->saveShippingTemp($sqlval); 169 $objPurchase->saveOrderTemp($uniqid, $sqlval, $objCustomer); 170 //$this->lfRegistDelivData($uniqid, $objCustomer); 166 171 // 正常に登録されたことを記録しておく 167 172 $objSiteSess->setRegistFlag(); -
branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php
r19860 r19861 143 143 if(count($this->arrErr) == 0) { 144 144 // DBへのデータ登録 145 $this->lfRegistData($uniqid); 145 $this->lfRegistData($uniqid, $objPurchase); 146 $_SESSION['shipping'][0]['time_id'] = $this->objFormParam->getValue('deliv_time_id'); 147 $_SESSION['shipping'][0]['deliv_date'] = $this->objFormParam->getValue('deliv_date'); 146 148 // 正常に登録されたことを記録しておく 147 149 $objSiteSess->setRegistFlag(); 148 150 // 確認ページへ移動 149 $this->objDisplay->redirect($this->getLocation(SHOPPING_CONFIRM_URL_PATH, array(), true));151 SC_Response_Ex::sendRedirect(SHOPPING_CONFIRM_URL_PATH); 150 152 exit; 151 153 }else{ … … 161 163 // 正常な推移であることを記録しておく 162 164 $objSiteSess->setRegistFlag(); 163 $this->objDisplay->redirect(SHOPPING_URL);165 SC_Response_Ex::sendRedirect(SHOPPING_URL); 164 166 exit; 165 167 break; … … 364 366 $this->objFormParam->addParam("お支払い方法", "payment_id", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK")); 365 367 $this->objFormParam->addParam("ポイント", "use_point", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK", "ZERO_START")); 366 $this->objFormParam->addParam("お届け時間", "deliv_time_id", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK") , "", false);368 $this->objFormParam->addParam("お届け時間", "deliv_time_id", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK")); 367 369 $this->objFormParam->addParam("ご質問", "message", LTEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK")); 368 370 $this->objFormParam->addParam("ポイントを使用する", "point_check", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"), '2'); 369 $this->objFormParam->addParam("お届け日", "deliv_date", STEXT_LEN, "KVa", array("MAX_LENGTH_CHECK") , "", false);371 $this->objFormParam->addParam("お届け日", "deliv_date", STEXT_LEN, "KVa", array("MAX_LENGTH_CHECK")); 370 372 } 371 373 … … 427 429 428 430 /* DBへデータの登録 */ 429 function lfRegistData($uniqid) { 430 $objDb = new SC_Helper_DB_Ex(); 431 function lfRegistData($uniqid, &$objPurchase) { 431 432 432 433 $sqlval = $this->objFormParam->getDbArray(); … … 444 445 } 445 446 446 // 受注_Tempテーブルに登録 447 $objDb->sfRegistTempOrder($uniqid, $sqlval); 447 $objPurchase->saveOrderTemp($uniqid, $sqlval); 448 448 } 449 449
Note: See TracChangeset
for help on using the changeset viewer.