- Timestamp:
- 2013/02/18 19:09:54 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/helper/SC_Helper_Purchase.php
r22554 r22567 32 32 * @version $Id$ 33 33 */ 34 class SC_Helper_Purchase { 34 class SC_Helper_Purchase 35 { 35 36 36 37 var $arrShippingKey = array( … … 60 61 * @return void 61 62 */ 62 function completeOrder($orderStatus = ORDER_NEW) { 63 function completeOrder($orderStatus = ORDER_NEW) 64 { 63 65 $objQuery =& SC_Query_Ex::getSingletonInstance(); 64 66 $objSiteSession = new SC_SiteSession_Ex(); … … 115 117 * @return void 116 118 */ 117 function cancelOrder($order_id, $orderStatus = ORDER_CANCEL, $is_delete = false) { 119 function cancelOrder($order_id, $orderStatus = ORDER_CANCEL, $is_delete = false) 120 { 118 121 $objQuery =& SC_Query_Ex::getSingletonInstance(); 119 122 $in_transaction = $objQuery->inTransaction(); … … 157 160 * @return string 受注一時ID 158 161 */ 159 function rollbackOrder($order_id, $orderStatus = ORDER_CANCEL, $is_delete = false) { 162 function rollbackOrder($order_id, $orderStatus = ORDER_CANCEL, $is_delete = false) 163 { 160 164 $objQuery =& SC_Query_Ex::getSingletonInstance(); 161 165 $in_transaction = $objQuery->inTransaction(); … … 199 203 * @return void 200 204 */ 201 function verifyChangeCart($uniqId, &$objCartSession) { 205 function verifyChangeCart($uniqId, &$objCartSession) 206 { 202 207 $cartKey = $objCartSession->getKey(); 203 208 … … 234 239 * @return array 受注一時情報の配列 235 240 */ 236 function getOrderTemp($uniqId) { 241 function getOrderTemp($uniqId) 242 { 237 243 $objQuery =& SC_Query_Ex::getSingletonInstance(); 238 244 return $objQuery->getRow('*', 'dtb_order_temp', 'order_temp_id = ?', array($uniqId)); … … 245 251 * @return array 受注一時情報の配列 246 252 */ 247 function getOrderTempByOrderId($order_id) { 253 function getOrderTempByOrderId($order_id) 254 { 248 255 $objQuery =& SC_Query_Ex::getSingletonInstance(); 249 256 return $objQuery->getRow('*', 'dtb_order_temp', 'order_id = ?', array($order_id)); … … 260 267 * @return void 261 268 */ 262 function saveOrderTemp($uniqId, $params, &$objCustomer = NULL) { 269 function saveOrderTemp($uniqId, $params, &$objCustomer = NULL) 270 { 263 271 if (SC_Utils_Ex::isBlank($uniqId)) { 264 272 return; … … 295 303 * @param bool $has_shipment_item 配送商品を保有している配送先のみ返す。 296 304 */ 297 function getShippingTemp($has_shipment_item = false) { 305 function getShippingTemp($has_shipment_item = false) 306 { 298 307 if ($has_shipment_item) { 299 308 $arrReturn = array(); … … 314 323 * @return void 315 324 */ 316 function clearShipmentItemTemp($shipping_id = null) { 325 function clearShipmentItemTemp($shipping_id = null) 326 { 317 327 if (is_null($shipping_id)) { 318 328 foreach ($_SESSION['shipping'] as $key => $value) { … … 334 344 * @return void 335 345 */ 336 function setShipmentItemTemp($shipping_id, $product_class_id, $quantity) { 346 function setShipmentItemTemp($shipping_id, $product_class_id, $quantity) 347 { 337 348 // 配列が長くなるので, リファレンスを使用する 338 349 $arrItems =& $_SESSION['shipping'][$shipping_id]['shipment_item'][$product_class_id]; … … 364 375 * 配送先都道府県の配列を返す. 365 376 */ 366 function getShippingPref($is_multiple) { 377 function getShippingPref($is_multiple) 378 { 367 379 $results = array(); 368 380 foreach (SC_Helper_Purchase_Ex::getShippingTemp($is_multiple) as $val) { … … 377 389 * @return boolean 複数配送指定の購入の場合 true 378 390 */ 379 function isMultiple() { 391 function isMultiple() 392 { 380 393 return count(SC_Helper_Purchase_Ex::getShippingTemp(true)) >= 2; 381 394 } … … 389 402 * @return void 390 403 */ 391 function saveShippingTemp($arrSrc, $shipping_id = 0) { 404 function saveShippingTemp($arrSrc, $shipping_id = 0) 405 { 392 406 // 配送商品は引き継がない 393 407 unset($arrSrc['shipment_item']); … … 407 421 * @return void 408 422 */ 409 function unsetShippingTemp() { 423 function unsetShippingTemp() 424 { 410 425 SC_Helper_Purchase_Ex::unsetAllShippingTemp(true); 411 426 } … … 417 432 * @return void 418 433 */ 419 static function unsetAllShippingTemp($multiple_temp = false) { 434 static function unsetAllShippingTemp($multiple_temp = false) 435 { 420 436 unset($_SESSION['shipping']); 421 437 if ($multiple_temp) { … … 430 446 * @return void 431 447 */ 432 static function unsetOneShippingTemp($shipping_id) { 448 static function unsetOneShippingTemp($shipping_id) 449 { 433 450 unset($_SESSION['shipping'][$shipping_id]); 434 451 } … … 492 509 * @return void 493 510 */ 494 function copyFromOrder(&$dest, $src, $prefix = 'shipping', $src_prefix = 'order', $arrKey = null) { 511 function copyFromOrder(&$dest, $src, $prefix = 'shipping', $src_prefix = 'order', $arrKey = null) 512 { 495 513 if (is_null($arrKey)) { 496 514 $arrKey = $this->arrShippingKey; … … 515 533 * @return void 516 534 */ 517 function extractShipping($arrSrc) { 535 function extractShipping($arrSrc) 536 { 518 537 $arrKey = array(); 519 538 foreach ($this->arrShippingKey as $key) { … … 530 549 * @return array 購入金額に応じた支払方法の配列 531 550 */ 532 function getPaymentsByPrice($total, $deliv_id) { 551 function getPaymentsByPrice($total, $deliv_id) 552 { 533 553 534 554 $arrPaymentIds = SC_Helper_Delivery_Ex::getPayments($deliv_id); … … 574 594 * お届け日一覧を取得する. 575 595 */ 576 function getDelivDate(&$objCartSess, $productTypeId) { 596 function getDelivDate(&$objCartSess, $productTypeId) 597 { 577 598 $cartList = $objCartSess->getCartList($productTypeId); 578 599 $delivDateIds = array(); … … 632 653 * お届け可能日のスタート値から, お届け日の配列を取得する. 633 654 */ 634 function getDateArray($start_day, $end_day) { 655 function getDateArray($start_day, $end_day) 656 { 635 657 $masterData = new SC_DB_MasterData_Ex(); 636 658 $arrWDAY = $masterData->getMasterData('mtb_wday'); … … 665 687 * @return void 666 688 */ 667 function registerShipping($order_id, $arrParams, $convert_shipping_date = true) { 689 function registerShipping($order_id, $arrParams, $convert_shipping_date = true) 690 { 668 691 $objQuery =& SC_Query_Ex::getSingletonInstance(); 669 692 $table = 'dtb_shipping'; … … 703 726 * @return void 704 727 */ 705 function registerShipmentItem($order_id, $shipping_id, $arrParams) { 728 function registerShipmentItem($order_id, $shipping_id, $arrParams) 729 { 706 730 $objQuery =& SC_Query_Ex::getSingletonInstance(); 707 731 $table = 'dtb_shipment_item'; … … 759 783 * @param integer 受注ID 760 784 */ 761 function registerOrderComplete($orderParams, &$objCartSession, $cartKey) { 785 function registerOrderComplete($orderParams, &$objCartSession, $cartKey) 786 { 762 787 $objQuery =& SC_Query_Ex::getSingletonInstance(); 763 788 … … 829 854 * @return integer 受注ID 830 855 */ 831 function registerOrder($order_id, $arrParams) { 856 function registerOrder($order_id, $arrParams) 857 { 832 858 $table = 'dtb_order'; 833 859 $where = 'order_id = ?'; … … 883 909 * @return void 884 910 */ 885 function registerOrderDetail($order_id, $arrParams) { 911 function registerOrderDetail($order_id, $arrParams) 912 { 886 913 $table = 'dtb_order_detail'; 887 914 $where = 'order_id = ?'; … … 904 931 * @return array 受注情報の配列 905 932 */ 906 function getOrder($order_id, $customer_id = null) { 933 function getOrder($order_id, $customer_id = null) 934 { 907 935 $objQuery =& SC_Query_Ex::getSingletonInstance(); 908 936 $where = 'order_id = ?'; … … 922 950 * @return array 受注詳細の配列 923 951 */ 924 function getOrderDetail($order_id, $has_order_status = true) { 952 function getOrderDetail($order_id, $has_order_status = true) 953 { 925 954 $objQuery =& SC_Query_Ex::getSingletonInstance(); 926 955 $dbFactory = SC_DB_DBFactory_Ex::getInstance(); … … 979 1008 * @return void 980 1009 */ 981 function setDownloadableFlgTo(&$arrOrderDetail) { 1010 function setDownloadableFlgTo(&$arrOrderDetail) 1011 { 982 1012 foreach ($arrOrderDetail as $key => $value) { 983 1013 // 販売価格が 0 円 … … 1002 1032 * @return array 配送情報の配列 1003 1033 */ 1004 function getShippings($order_id, $has_items = true) { 1034 function getShippings($order_id, $has_items = true) 1035 { 1005 1036 $objQuery =& SC_Query_Ex::getSingletonInstance(); 1006 1037 $arrResults = array(); … … 1032 1063 * @return array 商品規格IDをキーにした配送商品の配列 1033 1064 */ 1034 function getShipmentItems($order_id, $shipping_id, $has_detail = true) { 1065 function getShipmentItems($order_id, $shipping_id, $has_detail = true) 1066 { 1035 1067 $objQuery =& SC_Query_Ex::getSingletonInstance(); 1036 1068 $objProduct = new SC_Product_Ex(); … … 1064 1096 * @return void 1065 1097 */ 1066 function sendOrderMail($orderId) { 1098 function sendOrderMail($orderId) 1099 { 1067 1100 $mailHelper = new SC_Helper_Mail_Ex(); 1068 1101 $template_id = … … 1083 1116 * @return void 1084 1117 */ 1085 function sfUpdateOrderStatus($orderId, $newStatus = null, $newAddPoint = null, $newUsePoint = null, &$sqlval = array()) { 1118 function sfUpdateOrderStatus($orderId, $newStatus = null, $newAddPoint = null, $newUsePoint = null, &$sqlval = array()) 1119 { 1086 1120 $objQuery =& SC_Query_Ex::getSingletonInstance(); 1087 1121 $arrOrderOld = $objQuery->getRow('status, add_point, use_point, customer_id', 'dtb_order', 'order_id = ?', array($orderId)); … … 1191 1225 * @static 1192 1226 */ 1193 function sfUpdateOrderNameCol($order_id, $temp_table = false) { 1227 function sfUpdateOrderNameCol($order_id, $temp_table = false) 1228 { 1194 1229 $objQuery =& SC_Query_Ex::getSingletonInstance(); 1195 1230 … … 1229 1264 * @return boolean 使用するか(会員テーブルから減算するか) 1230 1265 */ 1231 function isUsePoint($status) { 1266 function isUsePoint($status) 1267 { 1232 1268 if ($status == null) { 1233 1269 return false; … … 1249 1285 * @return boolean 加算するか 1250 1286 */ 1251 function isAddPoint($status) { 1287 function isAddPoint($status) 1288 { 1252 1289 switch ($status) { 1253 1290 case ORDER_NEW: // 新規注文 … … 1285 1322 * @param integer $cartKey 登録を行うカート情報のキー 1286 1323 */ 1287 function cleanupSession($orderId, &$objCartSession, &$objCustomer, $cartKey) { 1324 function cleanupSession($orderId, &$objCartSession, &$objCustomer, $cartKey) 1325 { 1288 1326 // カートの内容を削除する. 1289 1327 $objCartSession->delAllProducts($cartKey); … … 1302 1340 * @return void 1303 1341 */ 1304 function setShipmentItemTempForSole(&$objCartSession, $shipping_id = 0) { 1342 function setShipmentItemTempForSole(&$objCartSession, $shipping_id = 0) 1343 { 1305 1344 $objCartSess = new SC_CartSession_Ex(); 1306 1345 … … 1319 1358 * @return integer 1320 1359 */ 1321 public function getNextOrderID() { 1360 public function getNextOrderID() 1361 { 1322 1362 $objQuery =& SC_Query_Ex::getSingletonInstance(); 1323 1363 return $objQuery->nextVal('dtb_order_order_id');
Note: See TracChangeset
for help on using the changeset viewer.