Ignore:
Timestamp:
2007/08/24 21:56:02 (17 years ago)
Author:
nanasess
Message:

リファクタリングと未定義変数の修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/util/SC_Utils.php

    r15343 r15351  
    732732    } 
    733733 
    734     /* 所属するすべての階層の親IDを配列で返す */ 
    735     function sfGetParents($objQuery, $table, $pid_name, $id_name, $id) { 
    736         $arrRet = SC_Utils::sfGetParentsArray($table, $pid_name, $id_name, $id); 
    737         // 配列の先頭1つを削除する。 
    738         array_shift($arrRet); 
    739         return $arrRet; 
    740     } 
    741  
    742  
    743734    /* 親IDの配列を元に特定のカラムを取得する。*/ 
    744735    function sfGetParentsCol($objQuery, $table, $id_name, $col_name, $arrId ) { 
     
    757748        $objQuery->setorder("level"); 
    758749        $arrRet = $objQuery->select($col, $table, $where, $arrId); 
    759         return $arrRet; 
    760     } 
    761  
    762     /* 子IDの配列を返す */ 
    763     function sfGetChildsID($table, $pid_name, $id_name, $id) { 
    764         $arrRet = SC_Utils::sfGetChildrenArray($table, $pid_name, $id_name, $id); 
    765750        return $arrRet; 
    766751    } 
     
    866851        } 
    867852        //複数のキャンペーンに登録されている商品は、最新のキャンペーンからポイントを取得 
    868         if($arrRet[0]['campaign_point_rate'] != "") { 
     853        if(isset($arrRet[0]['campaign_point_rate']) 
     854           && $arrRet[0]['campaign_point_rate'] != "") { 
     855 
    869856            $campaign_point_rate = $arrRet[0]['campaign_point_rate']; 
    870857            $real_point = $campaign_point_rate / 100; 
     
    892879        } 
    893880        //キャンペーン商品の場合 
    894         if($campaign_point_rate != "") { 
     881        if(isset($campaign_point_rate) && $campaign_point_rate != "") { 
    895882            $ret = "(".$arrRet[0]['campaign_name']."ポイント率".$campaign_point_rate."%)".$ret; 
    896883        } 
     
    963950    /* 集計情報を元に最終計算 */ 
    964951    function sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo, $objCustomer = "") { 
     952        // 未定義変数を定義 
     953        if (!isset($arrData['deliv_pref'])) $arrData['deliv_pref'] = ""; 
     954        if (!isset($arrData['payment_id'])) $arrData['payment_id'] = ""; 
     955        if (!isset($arrData['charge'])) $arrData['charge'] = ""; 
     956        if (!isset($arrData['use_point'])) $arrData['use_point'] = ""; 
     957 
    965958        // 商品の合計個数 
    966959        $total_quantity = $objCartSess->getTotalQuantity(true); 
     
    982975        if (OPTION_DELIV_FEE == 1) { 
    983976            // 送料の合計を計算する 
    984             $arrData['deliv_fee']+= SC_Utils::sfGetDelivFee($arrData['deliv_pref'], $arrData['payment_id']); 
     977            $arrData['deliv_fee'] 
     978                += SC_Utils::sfGetDelivFee($arrData['deliv_pref'], 
     979                                           $arrData['payment_id']); 
     980 
    985981        } 
    986982 
     
    13781374    } 
    13791375 
    1380     /* カテゴリから商品を検索する場合のWHERE文と値を返す */ 
    1381     function sfGetCatWhere($category_id) { 
    1382         // 子カテゴリIDの取得 
    1383         $arrRet = SC_Utils::sfGetChildsID("dtb_category", "parent_category_id", "category_id", $category_id); 
    1384         $tmp_where = ""; 
    1385         foreach ($arrRet as $val) { 
    1386             if($tmp_where == "") { 
    1387                 $tmp_where.= " category_id IN ( ?"; 
    1388             } else { 
    1389                 $tmp_where.= ",? "; 
    1390             } 
    1391             $arrval[] = $val; 
    1392         } 
    1393         $tmp_where.= " ) "; 
    1394         return array($tmp_where, $arrval); 
    1395     } 
    1396  
    13971376    /* 加算ポイントの計算式 */ 
    13981377    function sfGetAddPoint($totalpoint, $use_point, $arrInfo) { 
Note: See TracChangeset for help on using the changeset viewer.