Changeset 21324


Ignore:
Timestamp:
2011/11/10 22:23:33 (9 years ago)
Author:
Seasoft
Message:

#1547 (SC_Helper_DB#sfCountCategory 抽出条件の重複指定の懸念)
#1546 (SC_Helper_DB#sfCountCategory dtb_category_total_count の算出で在庫の有無を考慮できない)

  • 演算子の優先順位を誤り不適当な実装となっていた。#1547 の改訂で偶然改修された。新たな実装誤りを防ぐため、括弧で明示した。
File:
1 edited

Legend:

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

    r21323 r21324  
    657657        // 在庫無し商品の非表示 
    658658        if (NOSTOCK_HIDDEN) { 
    659             $sql_where_dtl = 'stock >= 1 OR stock_unlimited = 1'; 
     659            $sql_where_dtl = '(stock >= 1 OR stock_unlimited = 1)'; 
    660660            $from = $objProduct->alldtlSQL($sql_where_dtl); 
    661661        }else{ 
     
    773773            $where = "($sql_where) AND ($sql_where_product_ids)"; 
    774774 
     775            $where_products_class = ''; 
    775776            if (NOSTOCK_HIDDEN) { 
    776                 $sql_where_product_ids .= ' AND stock >= 1 OR stock_unlimited = 1'; 
    777             } 
    778  
    779             $from = $objProduct->alldtlSQL($sql_where_product_ids); 
     777                $where_products_class .= '(stock >= 1 OR stock_unlimited = 1)'; 
     778            } 
     779 
     780            $from = $objProduct->alldtlSQL($where_products_class); 
    780781            $sql = "SELECT count(*) FROM $from WHERE $where "; 
    781782            $arrUpdateData[ $category_id ] = $objQuery->getOne($sql, $arrval); 
Note: See TracChangeset for help on using the changeset viewer.