Ignore:
Timestamp:
2009/05/15 16:30:40 (15 years ago)
Author:
kajiwara
Message:

2.4.0 正式版のコミット。コミット内容の詳細はこちら(http://svn.ec-cube.net/open_trac/query?status=closed&milestone=EC-CUBE2.4.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2/data/class/helper/SC_Helper_DB.php

    r17655 r18007  
    294294        $objPage->tpl_total_pretax = 0;     // 費用合計(税込み) 
    295295        $objPage->tpl_total_tax = 0;        // 消費税合計 
    296         $objPage->tpl_total_point = 0;      // ポイント合計 
     296        if (USE_POINT === true) { 
     297            $objPage->tpl_total_point = 0;      // ポイント合計 
     298        } 
    297299 
    298300        // カート内情報の取得 
     
    370372                } 
    371373                // ポイント付与率の登録 
    372                 $objCartSess->setProductValue($arrCart[$i]['id'], 'point_rate', $arrData['point_rate']); 
     374                if (USE_POINT === true) { 
     375                    $objCartSess->setProductValue($arrCart[$i]['id'], 'point_rate', $arrData['point_rate']); 
     376                } 
    373377                // 商品ごとの合計金額 
    374378                $objPage->arrProductsClass[$cnt]['total_pretax'] = $objCartSess->getProductTotal($arrInfo, $arrCart[$i]['id']); 
     
    387391        $objPage->tpl_total_tax = $objCartSess->getAllProductsTax($arrInfo); 
    388392        // 全商品合計ポイント 
    389         $objPage->tpl_total_point = $objCartSess->getAllProductsPoint(); 
     393        if (USE_POINT === true) { 
     394            $objPage->tpl_total_point = $objCartSess->getAllProductsPoint(); 
     395        } 
    390396 
    391397        return $objPage; 
     
    509515        $customer_id = $arrRet[0]['customer_id']; 
    510516        if($customer_id != "" && $customer_id >= 1) { 
    511             $arrRet = $objQuery->select("point", "dtb_customer", "customer_id = ?", array($customer_id)); 
    512             $point = $arrRet[0]['point']; 
    513             $total_point = $arrRet[0]['point'] - $use_point + $add_point; 
     517            if (USE_POINT === true) { 
     518                $arrRet = $objQuery->select("point", "dtb_customer", "customer_id = ?", array($customer_id)); 
     519                $point = $arrRet[0]['point']; 
     520                $total_point = $arrRet[0]['point'] - $use_point + $add_point; 
     521            } else { 
     522                $total_point = ""; 
     523                $point = ""; 
     524            } 
    514525        } else { 
    515             $total_point = ""; 
    516             $point = ""; 
     526            $total_point = 0; 
     527            $point = 0; 
    517528        } 
    518529        return array($point, $total_point); 
    519530    } 
    520531 
     532    /** 
     533     * 顧客番号、利用ポイント、加算ポイントから最終ポイントを取得する. 
     534     * 
     535     * @param integer $customer_id 顧客番号 
     536     * @param integer $use_point 利用ポイント 
     537     * @param integer $add_point 加算ポイント 
     538     * @return array 最終ポイントの配列 
     539     */ 
     540    function sfGetCustomerPointFromCid($customer_id, $use_point, $add_point) { 
     541        $objQuery = new SC_Query(); 
     542        if (USE_POINT === true) { 
     543                $arrRet = $objQuery->select("point", "dtb_customer", "customer_id = ?", array($customer_id)); 
     544                $point = $arrRet[0]['point']; 
     545                $total_point = $arrRet[0]['point'] - $use_point + $add_point; 
     546        } else { 
     547            $total_point = 0; 
     548            $point = 0; 
     549        } 
     550        return array($point, $total_point); 
     551    } 
    521552    /** 
    522553     * カテゴリツリーの取得を行う. 
     
    593624        $arrRet = $objQuery->select($col, $from, $where); 
    594625 
    595         $arrCategory_id = $this->sfGetCategoryId($product_id, $status); 
     626        $arrCategory_id = $this->sfGetCategoryId($product_id); 
    596627 
    597628        $arrCatTree = array(); 
     
    11991230 
    12001231        // 自身のランクを取得する 
    1201         $rank = $objQuery->get($tableName, "rank", "$keyIdColumn = ?", array($keyId)); 
     1232        $rank = $objQuery->get($tableName, "rank", "$keyIdColumn = ? AND " . $where, array($keyId)); 
    12021233 
    12031234        $max = $objQuery->max($tableName, "rank", $where); 
    1204         // 値の調整(逆順) 
     1235        // 値の調整(逆順) 
    12051236        if($pos > $max) { 
    12061237            $position = 1; 
     
    12101241            $position = $max - $pos + 1; 
    12111242        } 
    1212          
     1243 
    12131244        //入れ替え先の順位が入れ換え元の順位より大きい場合 
    12141245        if( $position > $rank ) $term = "rank - 1"; 
     
    12251256            $sql.= " AND $where"; 
    12261257        } 
    1227         if( $position > $rank ) $objQuery->exec( $sql, array($rank, $position)); 
     1258        if( $position > $rank ) $objQuery->exec( $sql, array($rank, $position)); 
    12281259        if( $position < $rank ) $objQuery->exec( $sql, array($position, $rank)); 
    1229         // 指定した順位へrankを書き換える。 
     1260           // 指定した順位へrankを書き換える。 
    12301261        $sql  = "UPDATE $tableName SET rank = ? WHERE $keyIdColumn = ? "; 
    12311262        if($where != "") { 
    12321263            $sql.= " AND $where"; 
    12331264        } 
    1234         $objQuery->exec( $sql, array( $position, $keyId ) ); 
     1265        $objQuery->exec( $sql, array( $position, $keyId ) ); 
    12351266        $objQuery->commit(); 
    12361267    } 
     
    13741405     * @return string 指定の都道府県, 支払い方法の配送料金 
    13751406     */ 
    1376     function sfGetDelivFee($pref, $payment_id = "") { 
     1407    function sfGetDelivFee($arrData) { 
     1408        $pref = $arrData['deliv_pref']; 
     1409        $payment_id = isset($arrData['payment_id']) ? $arrData['payment_id'] : ""; 
     1410 
    13771411        $objQuery = new SC_Query(); 
    13781412 
     
    14441478        if (OPTION_DELIV_FEE == 1) { 
    14451479            // 送料の合計を計算する 
    1446             $arrData['deliv_fee'] 
    1447                 += $this->sfGetDelivFee($arrData['deliv_pref'], 
    1448                                            $arrData['payment_id']); 
    1449  
     1480            $arrData['deliv_fee'] += $this->sfGetDelivFee($arrData); 
    14501481        } 
    14511482 
     
    14721503        $arrData['payment_total'] = $arrData['total'] - ($arrData['use_point'] * POINT_VALUE); 
    14731504        // 加算ポイントの計算 
    1474         $arrData['add_point'] = SC_Utils::sfGetAddPoint($objPage->tpl_total_point, $arrData['use_point'], $arrInfo); 
    1475  
    1476         if($objCustomer != "") { 
    1477             // 誕生日月であった場合 
    1478             if($objCustomer->isBirthMonth()) { 
    1479                 $arrData['birth_point'] = BIRTH_MONTH_POINT; 
    1480                 $arrData['add_point'] += $arrData['birth_point']; 
     1505        if (USE_POINT === false) { 
     1506            $arrData['add_point'] = 0; 
     1507        } else { 
     1508            $arrData['add_point'] = SC_Utils::sfGetAddPoint($objPage->tpl_total_point, $arrData['use_point'], $arrInfo); 
     1509 
     1510            if($objCustomer != "") { 
     1511                // 誕生日月であった場合 
     1512                if($objCustomer->isBirthMonth()) { 
     1513                    $arrData['birth_point'] = BIRTH_MONTH_POINT; 
     1514                    $arrData['add_point'] += $arrData['birth_point']; 
     1515                } 
    14811516            } 
    14821517        } 
Note: See TracChangeset for help on using the changeset viewer.