Changeset 21325 for branches/version-2_11-dev/data/class/SC_Product.php
- Timestamp:
- 2011/11/10 23:40:41 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_11-dev/data/class/SC_Product.php
r21321 r21325 180 180 * @param SC_Query $objQuery SC_Query インスタンス 181 181 * @param array|int $arrProductId 商品ID 182 * @return array 商品一覧の配列 182 * @return array 商品一覧の配列 (キー: 商品ID) 183 183 */ 184 184 function getListByProductIds(&$objQuery, $arrProductId = array()) { … … 191 191 192 192 $objQuery->setWhere($where, $arrProductId); 193 $arrRet = $this->lists($objQuery); 194 return $arrRet; 193 $arrProducts = $this->lists($objQuery); 194 195 // 配列のキーを商品IDに 196 $arrTmp = array(); 197 foreach($arrProducts as $arrProduct) { 198 $arrTmp[$arrProduct['product_id']] = $arrProduct; 199 } 200 $arrProducts =& $arrTmp; 201 unset($arrTmp); 202 203 // SC_Query::setOrder() の指定がない場合、$arrProductId で指定された商品IDの順に配列要素を並び替え 204 if (strlen($objQuery->order) === 0) { 205 $arrTmp = array(); 206 foreach($arrProductId as $product_id) { 207 $arrTmp[$product_id] = $arrProducts[$product_id]; 208 } 209 $arrProducts =& $arrTmp; 210 unset($arrTmp); 211 } 212 213 return $arrProducts; 195 214 } 196 215
Note: See TracChangeset
for help on using the changeset viewer.