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

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

File:
1 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 
Note: See TracChangeset for help on using the changeset viewer.