Changeset 21326


Ignore:
Timestamp:
2011/11/11 00:02:56 (12 years ago)
Author:
Seasoft
Message:

#1536 (商品一覧画面 パラメータ NOSTOCK_HIDDEN = true で DB エラーが発生する)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/data/class/pages/products/LC_Page_Products_List.php

    r21325 r21326  
    398398        // 検索結果対象となる商品の数を取得 
    399399        $objQuery   =& SC_Query_Ex::getSingletonInstance(); 
    400         $objQuery->setWhere($searchCondition['where']); 
     400        $objQuery->setWhere($searchCondition['where_for_count']); 
    401401        $objProduct = new SC_Product_Ex(); 
    402402        return $objProduct->findProductCount($objQuery, $searchCondition['arrval']); 
     
    423423        // 商品検索条件の作成(未削除、表示) 
    424424        $searchCondition['where'] = "alldtl.del_flg = 0 AND alldtl.status = 1 "; 
    425  
    426         // 在庫無し商品の非表示 
    427         if (NOSTOCK_HIDDEN) { 
    428             $searchCondition['where'] .= ' AND (stock >= 1 OR stock_unlimited = 1)'; 
    429         } 
    430425 
    431426        if (strlen($searchCondition["where_category"]) >= 1) { 
     
    455450            $searchCondition['arrval'][] = $arrSearchData['maker_id']; 
    456451        } 
     452 
     453        $searchCondition['where_for_count'] = $searchCondition['where']; 
     454 
     455        // 在庫無し商品の非表示 
     456        if (NOSTOCK_HIDDEN) { 
     457            $searchCondition['where'] .= ' AND (stock >= 1 OR stock_unlimited = 1)'; 
     458            $searchCondition['where_for_count'] .= ' AND EXISTS(SELECT * FROM dtb_products_class WHERE product_id = alldtl.product_id AND del_flg = 0 AND (stock >= 1 OR stock_unlimited = 1))'; 
     459        } 
     460 
    457461        return $searchCondition; 
    458462    } 
Note: See TracChangeset for help on using the changeset viewer.