Changeset 21256


Ignore:
Timestamp:
2011/09/25 13:15:51 (13 years ago)
Author:
Seasoft
Message:

#1484 (SC_Product#lists の第2引数($arrVal)が実質的に無効)
#1449 (不要な関数・処理の整理)
#1421 (Fix typo.)
#1463 (コーディング規則に従っていない)

Location:
branches/version-2_11-dev/data/class
Files:
9 edited

Legend:

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

    r21245 r21256  
    137137     * 
    138138     * @param SC_Query $objQuery SC_Query インスタンス 
    139      * @param array $arrVal 検索パラメーター(ソート条件)の配列 
    140139     * @return array 商品一覧の配列 
    141140     */ 
    142     function lists(&$objQuery, $arrVal = array()) { 
     141    function lists(&$objQuery) { 
    143142        $col = <<< __EOS__ 
    144143             product_id 
     
    165164            ,update_date 
    166165__EOS__; 
    167         $res = $objQuery->select($col, $this->alldtlSQL($objQuery->where), 
    168                                  "", $arrVal); 
     166        $where = 'dtb_products_class.del_flg = 0'; 
     167        $res = $objQuery->select($col, $this->alldtlSQL($where)); 
    169168        return $res; 
     169    } 
     170 
     171 
     172    /** 
     173     * 商品IDを指定し、商品一覧を取得する 
     174     * 
     175     * SC_Query::setOrder() や SC_Query::setLimitOffset() を設定して, 商品一覧 
     176     * の配列を取得する. 
     177     * FIXME: 呼び出し元で設定した、SC_Query::setWhere() も有効に扱いたい。 
     178     * 
     179     * @param SC_Query $objQuery SC_Query インスタンス 
     180     * @param array|int $arrProductId 商品ID 
     181     * @return array 商品一覧の配列 
     182     */ 
     183    function getListByProductIds(&$objQuery, $arrProductId = array()) { 
     184        if (empty($arrProductId)) { 
     185            return array(); 
     186        } 
     187 
     188        $where = 'alldtl.product_id IN (' . implode(',', array_fill(0, count($arrProductId), '?')) . ')'; 
     189        $where .= ' AND alldtl.del_flg = 0'; 
     190 
     191        $objQuery->setWhere($where, $arrProductId); 
     192        $arrRet = $this->lists($objQuery); 
     193        return $arrRet; 
    170194    } 
    171195 
  • branches/version-2_11-dev/data/class/SC_Query.php

    r21254 r21256  
    3535 
    3636    var $instance; 
    37     var $option; 
    38     var $where; 
     37    var $option = ''; 
     38    var $where = ''; 
     39    var $arrWhereVal = array(); 
    3940    var $conn; 
    40     var $groupby; 
    41     var $order; 
     41    var $groupby = ''; 
     42    var $order = ''; 
    4243    var $force_run; 
    4344 
     
    8283        $this->dbFactory = SC_DB_DBFactory_Ex::getInstance(); 
    8384        $this->force_run = $force_run; 
    84         $this->where = ""; 
    85         $this->order = ""; 
    86         $this->groupby = ""; 
    87         $this->option = ""; 
    8885    } 
    8986 
     
    10198            $GLOBALS['_SC_Query_instance'] =& new SC_Query_Ex($dsn, $force_run, $new); 
    10299        } 
    103         $GLOBALS['_SC_Query_instance']->where = ""; 
    104         $GLOBALS['_SC_Query_instance']->order = ""; 
    105         $GLOBALS['_SC_Query_instance']->groupby = ""; 
    106         $GLOBALS['_SC_Query_instance']->option = ""; 
     100        $GLOBALS['_SC_Query_instance']->where = ''; 
     101        $GLOBALS['_SC_Query_instance']->arrWhereVal = array(); 
     102        $GLOBALS['_SC_Query_instance']->order = ''; 
     103        $GLOBALS['_SC_Query_instance']->groupby = ''; 
     104        $GLOBALS['_SC_Query_instance']->option = ''; 
    107105        return $GLOBALS['_SC_Query_instance']; 
    108106    } 
     
    126124     * @param string $table テーブル名 
    127125     * @param string $where where句 
    128      * @param array $arrval プレースホルダ 
     126     * @param array $arrWhereVal プレースホルダ 
    129127     * @return integer 件数 
    130128     */ 
    131     function count($table, $where = "", $arrval = array()) { 
     129    function count($table, $where = "", $arrWhereVal = array()) { 
    132130        if(strlen($where) <= 0) { 
    133131            $sqlse = "SELECT COUNT(*) FROM $table"; 
     
    136134        } 
    137135        $sqlse = $this->dbFactory->sfChangeMySQL($sqlse); 
    138         return $this->getOne($sqlse, $arrval); 
     136        return $this->getOne($sqlse, $arrWhereVal); 
    139137    } 
    140138 
     
    145143     * @param string $table テーブル名 
    146144     * @param string $where WHERE句 
    147      * @param array $arrval プレースホルダ 
     145     * @param array $arrWhereVal プレースホルダ 
    148146     * @param integer $fetchmode 使用するフェッチモード。デフォルトは MDB2_FETCHMODE_ASSOC。 
    149147     * @return array|null 
    150148     */ 
    151     function select($col, $table, $where = "", $arrval = array(), $fetchmode = MDB2_FETCHMODE_ASSOC) { 
    152         $sqlse = $this->getSql($col, $table, $where); 
    153         return $this->getAll($sqlse, $arrval, $fetchmode); 
     149    function select($col, $table, $where = "", $arrWhereVal = array(), $fetchmode = MDB2_FETCHMODE_ASSOC) { 
     150        $sqlse = $this->getSql($col, $table, $where, $arrWhereVal); 
     151        return $this->getAll($sqlse, $arrWhereVal, $fetchmode); 
    154152    } 
    155153 
     
    279277     * 構築した SELECT 文を取得する. 
    280278     * 
     279     * クラス変数から WHERE 句を組み立てる場合、$arrWhereVal を経由してプレースホルダもクラス変数のもので上書きする。 
    281280     * @param string $col SELECT 文に含めるカラム名 
    282281     * @param string $table SELECT 文に含めるテーブル名 
    283282     * @param string $where SELECT 文に含める WHERE 句 
     283     * @param mixed $arrWhereVal プレースホルダ(参照) 
    284284     * @return string 構築済みの SELECT 文 
    285285     */ 
    286     function getSql($col, $table, $where = '') { 
     286    function getSql($col, $table, $where = '', &$arrWhereVal = null) { 
    287287        $sqlse = "SELECT $col FROM $table"; 
    288288 
     
    292292        } elseif (strlen($this->where) >= 1) { 
    293293            $sqlse .= " WHERE " . $this->where; 
     294            if (empty($arrWhereVal)) { 
     295                $arrWhereVal = $this->arrWhereVal; 
     296            } 
    294297        } 
    295298 
     
    388391     * この関数で設定した値は SC_Query::getSql() で使用されます. 
    389392     * 
    390      * @param string $str WHERE 句に付与する文字列 
     393     * @param string $where WHERE 句に付与する文字列 
     394     * @param mixed $arrWhereVal プレースホルダ 
    391395     * @return SC_Query 自分自身のインスタンス 
    392396     */ 
    393     function setWhere($str) { 
    394         $this->where = $str; 
     397    function setWhere($where = '', $arrWhereVal = array()) { 
     398        $this->where = $where; 
     399        $this->arrWhereVal = $arrWhereVal; 
    395400        return $this; 
    396401    } 
     
    489494     * @param array $sqlval array('カラム名' => '値',...)の連想配列 
    490495     * @param string $where WHERE句 
    491      * @param array $arrValIn WHERE句用のプレースホルダ配列 (従来は追加カラム用も兼ねていた) 
     496     * @param array $arrWhereVal WHERE句用のプレースホルダ配列 (従来は追加カラム用も兼ねていた) 
    492497     * @param array $arrRawSql 追加カラム 
    493498     * @param array $arrRawSqlVal 追加カラム用のプレースホルダ配列 
    494499     * @return 
    495500     */ 
    496     function update($table, $sqlval, $where = "", $arrValIn = array(), $arrRawSql = array(), $arrRawSqlVal = array()) { 
     501    function update($table, $sqlval, $where = "", $arrWhereVal = array(), $arrRawSql = array(), $arrRawSqlVal = array()) { 
    497502        $arrCol = array(); 
    498503        $arrVal = array(); 
     
    528533        $strcol = implode(', ', $arrCol); 
    529534 
    530         if (is_array($arrValIn)) { // 旧版との互換用 
     535        if (is_array($arrWhereVal)) { // 旧版との互換用 
    531536            // プレースホルダー用に配列を追加 
    532             $arrVal = array_merge($arrVal, $arrValIn); 
     537            $arrVal = array_merge($arrVal, $arrWhereVal); 
    533538        } 
    534539 
     
    548553     * @param string $col カラム名 
    549554     * @param string $where 付与する WHERE 句 
    550      * @param array $arrval レースホルダに挿入する値 
     555     * @param array $arrval レースホルダに挿入する値 
    551556     * @return integer MAX文の実行結果 
    552557     */ 
     
    562567     * @param string $col カラム名 
    563568     * @param string $where 付与する WHERE 句 
    564      * @param array $arrval レースホルダに挿入する値 
     569     * @param array $arrval レースホルダに挿入する値 
    565570     * @return integer MIN文の実行結果 
    566571     */ 
     
    576581     * @param string $col カラム名 
    577582     * @param string $where 付与する WHERE 句 
    578      * @param array $arrval ブレースホルダに挿入する値 
     583     * @param array $arrWhereVal プレースホルダに挿入する値 
    579584     * @return mixed SQL の実行結果 
    580585     */ 
    581     function get($col, $table, $where = "", $arrval = array()) { 
    582         $sqlse = $this->getSql($col, $table, $where); 
     586    function get($col, $table, $where = "", $arrWhereVal = array()) { 
     587        $sqlse = $this->getSql($col, $table, $where, $arrWhereVal); 
    583588        // SQL文の実行 
    584         $ret = $this->getOne($sqlse, $arrval); 
     589        $ret = $this->getOne($sqlse, $arrWhereVal); 
    585590        return $ret; 
    586591    } 
     
    590595     * 
    591596     * @param string $sql 実行する SQL 
    592      * @param array $arrval レースホルダに挿入する値 
     597     * @param array $arrval レースホルダに挿入する値 
    593598     * @return mixed SQL の実行結果 
    594599     */ 
     
    616621     * @param string $col カラム名 
    617622     * @param string $where WHERE句 
    618      * @param array $arrVal プレースホルダ配列 
     623     * @param array $arrWhereVal プレースホルダ配列 
    619624     * @param integer $fetchmode 使用するフェッチモード。デフォルトは MDB2_FETCHMODE_ASSOC。 
    620625     * @return array array('カラム名' => '値', ...)の連想配列 
    621626     */ 
    622     function getRow($col, $table, $where = "", $arrVal = array(), $fetchmode = MDB2_FETCHMODE_ASSOC) { 
    623  
    624         $sql = $this->getSql($col, $table, $where); 
     627    function getRow($col, $table, $where = "", $arrWhereVal = array(), $fetchmode = MDB2_FETCHMODE_ASSOC) { 
     628 
     629        $sql = $this->getSql($col, $table, $where, $arrWhereVal); 
    625630        $sql = $this->dbFactory->sfChangeMySQL($sql); 
    626631 
     
    630635        } 
    631636 
    632         $affected =& $this->execute($sth, $arrVal); 
     637        $affected =& $this->execute($sth, $arrWhereVal); 
    633638        if (PEAR::isError($affected) && $this->force_run) { 
    634639            return; 
     
    639644 
    640645    /** 
    641      * SELECT 文の実行結果を 1のみ取得する. 
     646     * SELECT 文の実行結果を 1のみ取得する. 
    642647     * 
    643648     * @param string $table テーブル名 
    644649     * @param string $col カラム名 
    645650     * @param string $where 付与する WHERE 句 
    646      * @param array $arrval ブレースホルダに挿入する値 
     651     * @param array $arrWhereVal プレースホルダに挿入する値 
    647652     * @return array SQL の実行結果の配列 
    648653     */ 
    649     function getCol($col, $table, $where = "", $arrval = array()) { 
    650         $sql = $this->getSql($col, $table, $where); 
     654    function getCol($col, $table, $where = "", $arrWhereVal = array()) { 
     655        $sql = $this->getSql($col, $table, $where, $arrWhereVal); 
    651656        $sql = $this->dbFactory->sfChangeMySQL($sql); 
    652657 
     
    656661        } 
    657662 
    658         $affected =& $this->execute($sth, $arrval); 
     663        $affected =& $this->execute($sth, $arrWhereVal); 
    659664        if (PEAR::isError($affected) && $this->force_run) { 
    660665            return; 
     
    722727     * 
    723728     * @param string $n 実行する SQL 文 
    724      * @param array $arr レースホルダに挿入する値 
     729     * @param array $arr レースホルダに挿入する値 
    725730     * @param boolean $ignore_err MDB2切替で無効化されている (エラーが発生しても処理を続行する場合 true) 
    726731     * @param mixed $types プレースホルダの型指定 デフォルトnull = string 
     
    830835     * 
    831836     * TODO MDB2 に対応するための暫定的な措置. 
    832      *      レースホルダが使用できない実装があるため. 
     837     *      レースホルダが使用できない実装があるため. 
    833838     *      本来であれば, MDB2::prepare() を適切に使用するべき 
    834839     * 
     
    845850     * 
    846851     * @param string $table テーブル名 
    847      * @param array レースホルダの連想配列 
     852     * @param array レースホルダの連想配列 
    848853     * @return array テーブルに存在する列のみ抽出した連想配列 
    849854     */ 
     
    885890     * @access private 
    886891     * @param MDB2_Statement_Common プリペアドステートメントインスタンス 
    887      * @param array $arrVal レースホルダに挿入する配列 
     892     * @param array $arrVal レースホルダに挿入する配列 
    888893     * @return MDB2_Result 結果セットのインスタンス 
    889894     */ 
    890895    function execute(&$sth, $arrVal = array()) { 
    891896        $timeStart = SC_Utils_Ex::sfMicrotimeFloat(); 
    892         $affected =& $sth->execute($arrVal); 
     897        $affected =& $sth->execute((array)$arrVal); 
    893898 
    894899        // 一定以上時間かかったSQLの場合、ログ出力する。 
     
    947952     * 
    948953     * @param string $n 実行する SQL 文 
    949      * @param array $arr レースホルダに挿入する値 
     954     * @param array $arr レースホルダに挿入する値 
    950955     * @param boolean エラーが発生しても処理を続行する場合 true 
    951956     * @param mixed $types プレースホルダの型指定 デフォルトnull = string 
  • branches/version-2_11-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_RecommendSearch.php

    r21250 r21256  
    213213 
    214214    /** 
     215     * 商品取得 
    215216     *  
    216      * 商品取得 
    217      * @param array $arrProduct_id 
     217     * @param array $arrProductId 
    218218     * @param SC_Product $objProduct 
    219219     */ 
    220     function getProductList($arrProduct_id,&$objProduct){ 
    221         $where = ""; 
    222         if (is_array($arrProduct_id) && !empty($arrProduct_id)) { 
    223             $where = 'product_id IN (' . implode(',', $arrProduct_id) . ')'; 
    224         } else { 
    225             // 一致させない 
    226             $where = '0<>0'; 
    227         } 
     220    function getProductList($arrProductId, &$objProduct){ 
    228221        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    229         $objQuery->setWhere($where); 
     222 
    230223        // 表示順序 
    231224        $order = "update_date DESC, product_id DESC"; 
    232225        $objQuery->setOrder($order); 
    233         return $objProduct->lists($objQuery, $arrProduct_id); 
     226 
     227        return $objProduct->getListByProductIds($objQuery, $arrProductId); 
    234228    } 
    235229} 
  • branches/version-2_11-dev/data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php

    r20970 r21256  
    125125 
    126126    /** 
     127     * 商品取得 
    127128     *  
    128      * 商品取得 
    129      * @param array $arrProduct_id 
    130      * @param SC_Product $objProduct 
    131      */ 
    132     function getProductList($arrProduct_id,&$objProduct){ 
    133         $where = ""; 
    134         if (is_array($arrProduct_id) && !empty($arrProduct_id)) { 
    135             $where = 'product_id IN (' . implode(',', $arrProduct_id) . ')'; 
    136         } else { 
    137             // 一致させない 
    138             $where = '0<>0'; 
    139         } 
     129     * @param array $arrProductId 
     130     * @param SC_Product $objProduct 
     131     */ 
     132    function getProductList($arrProductId, &$objProduct){ 
    140133        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    141         $objQuery->setWhere($where); 
    142         return $objProduct->lists($objQuery, $arrProduct_id); 
     134 
     135        // 表示順序 
     136        $order = "update_date DESC, product_id DESC"; 
     137        $objQuery->setOrder($order); 
     138 
     139        return $objProduct->getListByProductIds($objQuery, $arrProductId); 
    143140    } 
    144141 
  • branches/version-2_11-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Recommend.php

    r21215 r21256  
    101101            // 商品一覧を取得 
    102102            // where条件生成&セット 
    103             $arrBestProductIds = array(); 
     103            $arrProductId = array(); 
    104104            $where = 'product_id IN ('; 
    105105            foreach ($arrBestProducts as $key => $val) { 
    106                 $arrBestProductIds[] = $val['product_id']; 
     106                $arrProductId[] = $val['product_id']; 
    107107            } 
    108             $where .= implode(', ', $arrBestProductIds); 
    109             $where .= ')'; 
    110             $where .= ' AND del_flg = 0'; // 商品規格の削除フラグ 
    111             $objQuery->setWhere($where); 
    112108            // 取得 
    113             $arrTmp = $objProduct->lists($objQuery); 
     109            $arrTmp = $objProduct->getListByProductIds($objQuery, $arrProductId); 
    114110            foreach ($arrTmp as $key => $arrRow) { 
    115111                $arrProductList[$arrRow['product_id']] = $arrRow; 
  • branches/version-2_11-dev/data/class/pages/mypage/LC_Page_Mypage_Favorite.php

    r21255 r21256  
    121121 
    122122        $objQuery->setOrder('create_date DESC'); 
    123         $arrProduct_id  = $objQuery->getCol('product_id', 'dtb_customer_favorite_products', 'customer_id = ?', array($customer_id)); 
     123        $arrProductId  = $objQuery->getCol('product_id', 'dtb_customer_favorite_products', 'customer_id = ?', array($customer_id)); 
    124124 
    125125        $objQuery       =& SC_Query_Ex::getSingletonInstance(); 
    126         $objQuery->setWhere($this->lfMakeWhere('alldtl.', $arrProduct_id)); 
     126        $objQuery->setWhere($this->lfMakeWhere('alldtl.', $arrProductId)); 
    127127        $linemax        = $objProduct->findProductCount($objQuery); 
    128128 
     
    137137        //$objQuery->setLimitOffset(SEARCH_PMAX, $startno); 
    138138        // 取得範囲の指定(開始行番号、行数のセット) 
    139         $arrProduct_id  = array_slice($arrProduct_id, $startno, SEARCH_PMAX); 
     139        $arrProductId  = array_slice($arrProductId, $startno, SEARCH_PMAX); 
    140140 
    141         $where = $this->lfMakeWhere('', $arrProduct_id); 
     141        $where = $this->lfMakeWhere('', $arrProductId); 
    142142        $where .= ' AND del_flg = 0'; 
    143         $objQuery->setWhere($where); 
    144         $arrProducts = $objProduct->lists($objQuery, $arrProduct_id); 
     143        $objQuery->setWhere($where, $arrProductId); 
     144        $arrProducts = $objProduct->lists($objQuery); 
    145145 
    146146        //取得している並び順で並び替え 
     
    150150        } 
    151151        $arrProductsList = array(); 
    152         foreach($arrProduct_id as $product_id) { 
     152        foreach($arrProductId as $product_id) { 
    153153            $arrProductsList[] = $arrProducts2[$product_id]; 
    154154        } 
     
    158158 
    159159    /* 仕方がない処理。。 */ 
    160     function lfMakeWhere ($tablename, $arrProduct_id) { 
     160    function lfMakeWhere ($tablename, $arrProductId) { 
    161161 
    162162        // 取得した表示すべきIDだけを指定して情報を取得。 
    163163        $where = ""; 
    164         if (is_array($arrProduct_id) && !empty($arrProduct_id)) { 
    165             $where = $tablename . 'product_id IN (' . implode(',', $arrProduct_id) . ')'; 
     164        if (is_array($arrProductId) && !empty($arrProductId)) { 
     165            $where = $tablename . 'product_id IN (' . implode(',', $arrProductId) . ')'; 
    166166        } else { 
    167167            // 一致させない 
  • branches/version-2_11-dev/data/class/pages/products/LC_Page_Products_Detail.php

    r21230 r21256  
    409409    /* 登録済み関連商品の読み込み */ 
    410410    function lfPreGetRecommendProducts($product_id) { 
    411         $arrRecommend = array(); 
     411        $objProduct = new SC_Product_Ex(); 
    412412        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     413 
    413414        $objQuery->setOrder("rank DESC"); 
    414415        $arrRecommendData = $objQuery->select("recommend_product_id, comment", "dtb_recommend_products", "product_id = ?", array($product_id)); 
     
    420421        } 
    421422 
    422         $objProduct = new SC_Product_Ex(); 
    423  
    424         $where = ""; 
    425         if (!empty($arrRecommendProductId)) { 
    426             $where = 'product_id IN (' . implode(',', $arrRecommendProductId) . ')'; 
    427         } else { 
    428             return $arrRecommend; 
    429         } 
    430423        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    431         $objQuery->setWhere($where); 
    432         $arrProducts = $objProduct->lists($objQuery, $arrRecommendProductId); 
     424        $arrProducts = $objProduct->getListByProductIds($objQuery, $arrRecommendProductId); 
    433425 
    434426        //取得している並び順で並び替え 
     
    438430            $arrProducts2[ $item['product_id'] ] = $item; 
    439431        } 
    440         $arrProducts = array(); 
     432 
     433        $arrRecommend = array(); 
    441434        foreach($arrRecommendProductId as $product_id) { 
    442435            $arrProducts2[$product_id]['comment'] = $arrRecommendData[$product_id]; 
  • branches/version-2_11-dev/data/class/pages/products/LC_Page_Products_List.php

    r21213 r21256  
    304304 
    305305         // 表示すべきIDとそのIDの並び順を一気に取得 
    306         $arrProduct_id = $objProduct->findProductIdsOrder($objQuery, array_merge($searchCondition['arrval'], $arrval_order)); 
    307  
    308         // 取得した表示すべきIDだけを指定して情報を取得。 
    309         $where = ""; 
    310         if (is_array($arrProduct_id) && !empty($arrProduct_id)) { 
    311             $where = 'product_id IN (' . implode(',', $arrProduct_id) . ')'; 
    312         } else { 
    313             // 一致させない 
    314             $where = '0<>0'; 
    315         } 
    316  
    317         $where .= ' AND del_flg = 0'; // 商品規格の削除フラグ 
     306        $arrProductId = $objProduct->findProductIdsOrder($objQuery, array_merge($searchCondition['arrval'], $arrval_order)); 
     307 
    318308        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    319         $objQuery->setWhere($where); 
    320         $arrProducts = $objProduct->lists($objQuery, $arrProduct_id); 
     309        $arrProducts = $objProduct->getListByProductIds($objQuery, $arrProductId); 
    321310 
    322311        //取得している並び順で並び替え 
     
    326315        } 
    327316        $arrProducts = array(); 
    328         foreach($arrProduct_id as $product_id) { 
     317        foreach($arrProductId as $product_id) { 
    329318            $arrProducts[] = $arrProducts2[$product_id]; 
    330319        } 
    331320 
    332321        // 規格を設定 
    333         $objProduct->setProductsClassByProductIds($arrProduct_id); 
    334         $arrProducts += array('productStatus' => $objProduct->getProductStatus($arrProduct_id)); 
     322        $objProduct->setProductsClassByProductIds($arrProductId); 
     323        $arrProducts += array('productStatus' => $objProduct->getProductStatus($arrProductId)); 
    335324        return $arrProducts; 
    336325    } 
  • branches/version-2_11-dev/data/class/pages/rss/LC_Page_Rss_Products.php

    r20976 r21256  
    244244     */ 
    245245    function lfGetProductsDetail(&$objQuery, $product_id = 'all'){ 
     246        $objProduct = new SC_Product_Ex(); 
     247 
    246248        // --- 商品詳細の取得 
    247         if ($product_id != 'all') { 
    248             $where = 'product_id = ' . $product_id; 
    249             $objQuery->setWhere($where); 
    250         } 
    251         $objQuery->setOrder('product_id'); 
    252         $objProduct = new SC_Product_Ex(); 
    253         $arrProductLsit = $objProduct->lists($objQuery); 
     249        if ($product_id == 'all') { 
     250            $objQuery->setOrder('product_id'); 
     251            $arrProductLsit = $objProduct->lists($objQuery); 
     252        } else { 
     253            $arrProductLsit = $objProduct->getListByProductIds($objQuery, $product_id); 
     254        } 
     255 
    254256        // 各商品のカテゴリIDとランクの取得 
    255257        $arrProduct = array(); 
Note: See TracChangeset for help on using the changeset viewer.