Index: branches/version-2_4/data/class/pages/mypage/LC_Page_Mypage_Favorite.php
===================================================================
--- branches/version-2_4/data/class/pages/mypage/LC_Page_Mypage_Favorite.php	(revision 17980)
+++ branches/version-2_4/data/class/pages/mypage/LC_Page_Mypage_Favorite.php	(revision 17983)
@@ -95,7 +95,6 @@
         }
 
-        $sql = "SELECT *
-                FROM
-                   (SELECT
+        $col = "*";
+        $from =" (SELECT
                         T2.product_id AS product_id_main,
                         T2.del_flg ,
@@ -112,7 +111,5 @@
                         FROM
                            dtb_customer_favorite_products
-                        WHERE
-                           customer_id = ?
-                        ) AS T1 INNER JOIN dtb_products AS T2 ON T1.product_id_c = T2.product_id AND T2.del_flg = 0 AND T2.status = 1
+                        ) AS T1 INNER JOIN dtb_products AS T2 ON T1.product_id_c = T2.product_id
                     ) AS T3 INNER JOIN
                         (SELECT
@@ -127,17 +124,15 @@
                             product_id
                     ) AS T4 ON T3.product_id_main = T4.product_id";
+        $where = "customer_id = ? AND del_flg = 0 AND status = 1";
         // 在庫無し商品の非表示
         if (NOSTOCK_HIDDEN === true) {
-            $sql .= " WHERE stock_max >= 1 OR stock_unlimited_max = 1";
-        }
-        $sql .= " ORDER BY create_date DESC";
+            $where .= " AND (stock_max >= 1 OR stock_unlimited_max = 1)";
+        }
+        $order = "create_date DESC";
 
         $arrval = array($objCustomer->getvalue('customer_id'));
 
-        //お気に入りの取得
-        $this->arrFavorite = $objQuery->getall($sql, $arrval);
-
         //お気に入りの数を取得
-        $linemax = count($this->arrFavorite);
+        $linemax = $objQuery->count($from, $where, $arrval);
         $this->tpl_linemax = $linemax;
 
@@ -151,4 +146,7 @@
         // 表示順序
         $objQuery->setorder($order);
+
+        //お気に入りの取得
+        $this->arrFavorite = $objQuery->select($col, $from, $where, $arrval);
 
         // パラメータ管理クラス
