Index: branches/version-2_12-dev/data/class/pages/products/LC_Page_Products_List.php
===================================================================
--- branches/version-2_12-dev/data/class/pages/products/LC_Page_Products_List.php	(revision 22486)
+++ branches/version-2_12-dev/data/class/pages/products/LC_Page_Products_List.php	(revision 22507)
@@ -375,11 +375,11 @@
         }
 
-        $searchCondition['where_for_count'] = $searchCondition['where'];
-
         // 在庫無し商品の非表示
         if (NOSTOCK_HIDDEN) {
             $searchCondition['where'] .= ' AND EXISTS(SELECT * FROM dtb_products_class WHERE product_id = alldtl.product_id AND del_flg = 0 AND (stock >= 1 OR stock_unlimited = 1))';
-            $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))';
-        }
+        }
+
+        // XXX 一時期内容が異なっていたことがあるので別要素にも格納している。
+        $searchCondition['where_for_count'] = $searchCondition['where'];
 
         return $searchCondition;
Index: branches/version-2_12-dev/data/class/SC_Product.php
===================================================================
--- branches/version-2_12-dev/data/class/SC_Product.php	(revision 22486)
+++ branches/version-2_12-dev/data/class/SC_Product.php	(revision 22507)
@@ -74,7 +74,6 @@
      */
     function findProductIdsOrder(&$objQuery, $arrVal = array()) {
-        $table = <<< __EOS__
-            dtb_products AS alldtl
-__EOS__;
+        $table = 'dtb_products AS alldtl';
+
         $objQuery->setGroupBy('alldtl.product_id');
         if (is_array($this->arrOrderData) and $objQuery->order == '') {
@@ -94,10 +93,7 @@
             $objQuery->setOrder($order);
         }
-        $results = $objQuery->select('alldtl.product_id', $table, '', $arrVal, MDB2_FETCHMODE_ORDERED);
-        $resultValues = array();
-        foreach ($results as $val) {
-            $resultValues[] = $val[0];
-        }
-        return $resultValues;
+        $arrReturn = $objQuery->getCol('alldtl.product_id', $table, '', $arrVal);
+
+        return $arrReturn;
     }
 
@@ -112,7 +108,6 @@
      */
     function findProductCount(&$objQuery, $arrVal = array()) {
-        $table = <<< __EOS__
-            dtb_products AS alldtl
-__EOS__;
+        $table = 'dtb_products AS alldtl';
+
         return $objQuery->count($table, '', $arrVal);
     }
@@ -154,4 +149,5 @@
 __EOS__;
         $res = $objQuery->select($col, $this->alldtlSQL());
+
         return $res;
     }
@@ -232,4 +228,5 @@
         $result = $this->getProductsClass($productClassId);
         $result = array_merge($result, $this->getDetail($result['product_id']));
+
         return $result;
     }
@@ -404,4 +401,5 @@
         $objQuery->setWhere('product_class_id = ? AND T1.del_flg = 0');
         $arrRes = $this->getProductsClassByQuery($objQuery, $productClassId);
+
         return (array)$arrRes[0];
     }
@@ -424,4 +422,5 @@
         }
         $objQuery->setWhere($where);
+
         return $this->getProductsClassByQuery($objQuery, $productIds);
     }
@@ -436,4 +435,5 @@
     function getProductsClassFullByProductId($productId, $has_deleted = false) {
         $arrRet = $this->getProductsClassByProductIds(array($productId), $has_deleted);
+
         return $arrRet;
     }
@@ -458,4 +458,5 @@
             $results[$status['product_id']][] = $status['product_status_id'];
         }
+
         return $results;
     }
@@ -504,4 +505,5 @@
             $limit = $p['stock'];
         }
+
         return $limit;
     }
@@ -701,4 +703,5 @@
             ) AS alldtl
 __EOS__;
+
         return $sql;
     }
@@ -750,4 +753,5 @@
         ) as prdcls
 __EOS__;
+
         return $sql;
     }
