Ignore:
Timestamp:
2010/10/20 19:13:15 (10 years ago)
Author:
nanasess
bzr:base-revision:
ohkouchi@loop-az.jp-20101019060210-f9ll2iywezf74j7f
bzr:committer:
Kentaro Ohkouchi <ohkouchi@loop-az.jp>
bzr:file-ids:

data/class/SC_Product.php 18277@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcomu-ver2%2Fdata%2Fclass%2FSC_Product.php
data/class/helper/SC_Helper_DB.php 15176@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fhelper%2FSC_Helper_DB.php
data/class/helper/SC_Helper_Purchase.php sc_helper_purchase.p-20101020100530-jyaoa7ch9pdfjqzp-1
data/class/pages/shopping/LC_Page_Shopping_Complete.php 15223@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fshopping%2FLC_Page_Shopping_Complete.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_Payment.php 15223@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fshopping%2FLC_Page_Shopping_Payment.php
data/class_extends/helper_extends/SC_Helper_Purchase_Ex.php sc_helper_purchase_e-20101020100531-2rjt2ynuw2t3vx6n-1
data/require_classes.php 18500@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fversion-2_4-dev%2Fdata%2Frequire_classes.php
bzr:mapping-version:
v4
bzr:repository-uuid:
1e3b908f-19a9-db11-a64c-001125224ba8
bzr:revision-id:
ohkouchi@loop-az.jp-20101020101311-splvyjvs8i4nlqbp
bzr:revno:
2340
bzr:revprop:branch-nick:
branches/version-2_5-dev
bzr:root:
branches/version-2_5-dev
bzr:timestamp:
2010-10-20 19:13:11.368999958 +0900
bzr:user-agent:
bzr2.2.0+bzr-svn1.0.3
svn:original-date:
2010-10-20T10:13:11.369000Z
Message:

ページ間の遷移方法の改善(#783)

  • PC版のみ実装
  • 購入関連の処理を SC_Helper_Purchase へ移動
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/SC_Product.php

    r18852 r18860  
    442442        } 
    443443        return $limit; 
     444    } 
     445 
     446    /** 
     447     * 在庫を減少させる. 
     448     * 
     449     * 指定の在庫数まで, 在庫を減少させる. 
     450     * 減少させた結果, 在庫数が 0 未満になった場合, 引数 $quantity が 0 の場合は, 
     451     * 在庫の減少を中止し, false を返す. 
     452     * 在庫の減少に成功した場合は true を返す. 
     453     * 
     454     * @param integer $productClassId 商品規格ID 
     455     * @param integer $quantity 減少させる在庫数 
     456     * @return boolean 在庫の減少に成功した場合 true; 失敗した場合 false 
     457     */ 
     458    function reduceStock($productClassId, $quantity) { 
     459 
     460        $productsClass = $this->getDetailAndProductsClass($productClassId); 
     461        if (($productsClass['stock_unlimited'] != '1' 
     462             && $productsClass['stock'] < $quantity) 
     463            || $quantity == 0) { 
     464            return false; 
     465        } 
     466 
     467        $objQuery =& SC_Query::getSingletonInstance(); 
     468        $objQuery->update('dtb_products_class', array(), 
     469                          "product_class_id = ?", array($productClassId), 
     470                          array('stock' => 'stock - ?'), array($quantity)); 
     471        // TODO エラーハンドリング 
     472        return true; 
    444473    } 
    445474 
Note: See TracChangeset for help on using the changeset viewer.