Changeset 18283
- Timestamp:
- 2009/09/07 23:48:32 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/class/pages/shopping/LC_Page_Shopping_Complete.php
r18276 r18283 646 646 $objDb = new SC_Helper_DB_Ex(); 647 647 648 if (!SC_Utils_Ex::sfIsInt($quantity)) { 649 $objQuery->rollback(); 650 SC_Utils_Ex::sfDispException(); 651 } 652 648 653 $where = "product_id = ? AND classcategory_id1 = ? AND classcategory_id2 = ?"; 649 654 $arrRet = $objQuery->select("stock, stock_unlimited", "dtb_products_class", $where, $arrID); 650 655 651 // 売り切れエラー652 if(($arrRet[0]['stock_unlimited'] != '1' && $arrRet[0]['stock'] < $quantity) || $quantity == 0) {656 if (($arrRet[0]['stock_unlimited'] != '1' && $arrRet[0]['stock'] < $quantity) || $quantity == 0) { 657 // 売り切れエラー 653 658 $objQuery->rollback(); 654 659 SC_Utils_Ex::sfDispSiteError(SOLD_OUT, "", true); 655 // 無制限の場合、在庫はNULL 656 } elseif($arrRet[0]['stock_unlimited'] == '1') { 657 $sqlval['stock'] = null; 658 $objQuery->update("dtb_products_class", $sqlval, $where, $arrID); 660 } 661 659 662 // 在庫を減らす 660 } else { 661 $sqlval['stock'] = ($arrRet[0]['stock'] - $quantity); 662 if($sqlval['stock'] == "") { 663 $sqlval['stock'] = '0'; 664 } 665 $objQuery->update("dtb_products_class", $sqlval, $where, $arrID); 666 } 663 $arrRawSql = array(); 664 $arrRawSql['stock'] = 'stock - ?'; 665 $arrRawSqlVal[] = $quantity; 666 $objQuery->update('dtb_products_class', array(), $where, $arrID, $arrRawSql, $arrRawSqlVal); 667 667 668 668 // 在庫無し商品の非表示対応 669 669 if (NOSTOCK_HIDDEN === true) { 670 671 670 // 件数カウントバッチ実行 671 $objDb->sfCategory_Count($objQuery); 672 672 } 673 673
Note: See TracChangeset
for help on using the changeset viewer.